xref: /PHP-7.3/ext/opcache/tests/bug74431.phpt (revision 75bc3446)
1--TEST--
2Bug #74431 - foreach infinite loop
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.optimization_level=0xffffffff
7--SKIPIF--
8<?php require_once('skipif.inc'); ?>
9--FILE--
10<?php
11function test(){
12    $arr = [1,2];
13    $j = 0;
14    $cond = true;
15    foreach ($arr as $i => $v){
16        while(1){
17            if($cond){
18                break;
19            }
20        }
21        $j++;
22        echo $j."\n";
23        if ($j>10) break;
24    }
25}
26test();
27?>
28--EXPECT--
291
302
31