Bug #74431 [Opn]: foreach infinite loop

From: Date: Thu, 13 Apr 2017 10:07:47 +0000
Subject: Bug #74431 [Opn]: foreach infinite loop
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-208516@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74431&edit=1 ID: 74431 User updated by: onceatease at gmail dot com Reported by: onceatease at gmail dot com Summary: foreach infinite loop Status: Open Type: Bug Package: opcache Operating System: Ubuntu 12.04.5 LTS -PHP Version: 7.1.3 +PHP Version: 7.1.2 Block user comment: N Private report: N New Comment: exec correctly in php7.1.0 test without php7.1.3 Previous Comments: ------------------------------------------------------------------------ [2017-04-13 10:02:02] onceatease at gmail dot com Description: ------------ foreach will infinite loop in php-fpm, in the case while condition is literal and if conditon is a variable(in both php7.1.2 and php7.1.4) Test script: --------------- $arr = [1,2]; $j = 0; $cond = true; foreach ($arr as $i => $v){ while(1){ if($cond){ break; } } $j++; echo $j."<br>"; //if($j>100) break; } ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=74431&edit=1

« previous php.bugs (#208516) next »