mirror of
https://github.com/php/php-src.git
synced 2024-12-18 14:30:35 +08:00
6079ba4b0c
We need to be careful about correctly handling that undef results in a null value. Otherwise, apart from simply generating incorrect results, we may also end up performing non-monotonic lattice transitions, thus causing an infinite type inference loop (see test).
18 lines
260 B
PHP
18 lines
260 B
PHP
--TEST--
|
|
Type inference should not result in infinite loop
|
|
--FILE--
|
|
<?php
|
|
|
|
function test() {
|
|
$b = false;
|
|
do {
|
|
$a = $a + PHP_INT_MAX + 2;
|
|
$a = 0;
|
|
} while ($b);
|
|
}
|
|
test();
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Notice: Undefined variable: a in %s on line %d
|