mirror of
https://github.com/php/php-src.git
synced 2026-03-26 09:12:14 +01:00
All these tests are meant to run with OPcache available, and some will even fail inevitably without it, so we add OPcache as SKIPIF requirement.
31 lines
472 B
PHP
31 lines
472 B
PHP
--TEST--
|
|
Bug #74431 - foreach infinite loop
|
|
--INI--
|
|
opcache.enable=1
|
|
opcache.enable_cli=1
|
|
opcache.optimization_level=0xffffffff
|
|
--SKIPIF--
|
|
<?php require_once('skipif.inc'); ?>
|
|
--FILE--
|
|
<?php
|
|
function test(){
|
|
$arr = [1,2];
|
|
$j = 0;
|
|
$cond = true;
|
|
foreach ($arr as $i => $v){
|
|
while(1){
|
|
if($cond){
|
|
break;
|
|
}
|
|
}
|
|
$j++;
|
|
echo $j."\n";
|
|
if ($j>10) break;
|
|
}
|
|
}
|
|
test();
|
|
?>
|
|
--EXPECT--
|
|
1
|
|
2
|