blob: 48609dc57b1f5f595fabee101817c1875ca175f4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
--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
|