com php-src: Test for bug 74431: ext/opcache/tests/bug74431.phpt

[email protected] (Nikita Popov)
Newsgroups php.cvs
Message-ID <[email protected]>
Commit:    5d095f80c9348ec4948f9024236eadafb46ff6b5
Author:    ekinhbayar <[email protected]>         Fri, 14 Apr 2017 17:28:57 +0300
Committer: Nikita Popov <[email protected]>      Fri, 14 Apr 2017 21:26:02 +0200
Parents:   b760508adc0f6046ee5d8e529578e96889fb712e
Branches:  PHP-7.1 master

Link:       http://git.php.net/?p=php-src.git;a=commitdiff;h=5d095f80c9348ec4948f9024236eadafb46ff6b5

Log:
Test for bug 74431

Bugs:
https://bugs.php.net/74431

Changed paths:
  A  ext/opcache/tests/bug74431.phpt


Diff:
diff --git a/ext/opcache/tests/bug74431.phpt b/ext/opcache/tests/bug74431.phpt
new file mode 100644
index 0000000..40948ba
--- /dev/null
+++ b/ext/opcache/tests/bug74431.phpt
@@ -0,0 +1,28 @@
+--TEST--
+Bug #74431 - foreach infinite loop
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=0xffffffff
+--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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.