]> granicus.if.org Git - php/commitdiff
Add test for bug #75681
authorNikita Popov <nikita.ppv@gmail.com>
Sat, 16 Dec 2017 20:24:26 +0000 (21:24 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Sat, 16 Dec 2017 20:24:26 +0000 (21:24 +0100)
The issue itself has been fixed by 8a4532319dfae83ff16b2d2bbfeed062924c3c27.

NEWS
ext/opcache/tests/bug75681.phpt [new file with mode: 0644]

diff --git a/NEWS b/NEWS
index 7dec72ca52176881e6a613f87defc35a4315e498..79f9df112f5cb97b3fada7ac3748adcb8e29054b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -39,6 +39,8 @@ PHP                                                                        NEWS
     (Laruence, Dmitry)
   . Fixed bug #75570 ("Narrowing occurred during type inference" error).
     (Dmitry)
+  . Fixed bug #75681 (Warning: Narrowing occurred during type inference,
+    specific case). (Nikita)
   . Fixed bug #75556 (Invalid opcode 138/1/1). (Laruence)
 
 - PCRE:
diff --git a/ext/opcache/tests/bug75681.phpt b/ext/opcache/tests/bug75681.phpt
new file mode 100644 (file)
index 0000000..72e9d4a
--- /dev/null
@@ -0,0 +1,26 @@
+--TEST--
+Bug #75681: Warning: Narrowing occurred during type inference (specific case)
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+
+function foobar()
+{
+    do {
+        foreach ($a as $i => $_) {
+            $a[$i][0] += 1;
+        }
+
+        $a[] = array(0, 0);
+    } while ($x !== false);
+}
+
+?>
+===DONE===
+--EXPECT--
+===DONE===