php-src/Zend/tests/inference_infinite_loop.phpt
Nikita Popov 6079ba4b0c Inference: Fix undef handling for binary ops
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).
2016-05-14 17:16:32 +02:00

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