php-src/Zend/tests/foreach_over_null.phpt
Nikita Popov a99d08b5d1 Fix type inference for FE_RESET on invalid type
FE_RESET sets the result to UNDEF in this case. We should infer
some type here, because no type generally implies unreachable
code. In this case SCCP ended up replacing the FE_RESET result
with null, including in FE_FREE.
2020-09-01 13:59:36 +02:00

16 lines
228 B
PHP

--TEST--
foreach over null
--FILE--
<?php
function test() {
foreach (null as $v) {
echo "Foo\n";
}
}
test();
?>
--EXPECTF--
Warning: foreach() argument must be of type array|object, null given in %s on line %d