mirror of
https://github.com/php/php-src.git
synced 2024-12-18 06:21:41 +08:00
a99d08b5d1
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.
16 lines
228 B
PHP
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
|