php-8.0.30-src/ext/opcache/tests/sccp_loop_var_free.phpt

19 lines
292 B
PHP

--TEST--
Check that SCCP correctly handles non-terminating frees of loop variables
--FILE--
<?php
function test() {
$arr = [];
foreach ($arr as $item) {
if (!empty($result)) {
return $result;
}
}
return 2;
}
var_dump(test());
?>
--EXPECT--
int(2)