]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.4' into PHP-8.0
authorNikita Popov <nikita.ppv@gmail.com>
Fri, 30 Oct 2020 14:52:24 +0000 (15:52 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Fri, 30 Oct 2020 14:52:46 +0000 (15:52 +0100)
* PHP-7.4:
  Fix SSA integrity violation for type inference in dead code

1  2 
Zend/tests/dead_array_type_inference.phpt
ext/opcache/Optimizer/zend_inference.c

index 0000000000000000000000000000000000000000,51f9b05816ea516eecf160bb4fd8f62f7aeae9c7..f0f9d51ee2d45b5ed95314f9468a5c3921e6988b
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,18 +1,18 @@@
 -Notice: Undefined variable: a in %s on line %d
+ --TEST--
+ Make sure type inference upholds invariants for dead arrays
+ --FILE--
+ <?php
+ function test() {
+     foreach ($a as $v) {
+         $b[] = $v;
+     }
+ }
+ test();
+ ?>
+ --EXPECTF--
 -Warning: Invalid argument supplied for foreach() in %s on line %d
++Warning: Undefined variable $a in %s on line %d
++Warning: foreach() argument must be of type array|object, null given in %s on line %d