We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8286de2 commit 3e78964Copy full SHA for 3e78964
ext/opcache/Optimizer/zend_inference.c
@@ -2639,6 +2639,9 @@ static zend_always_inline int _zend_update_type_info(
2639
tmp |= MAY_BE_NULL|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_STRING;
2640
}
2641
2642
+ if (!tmp) {
2643
+ tmp = MAY_BE_NULL;
2644
+ }
2645
tmp |= MAY_BE_RC1 | MAY_BE_RCN;
2646
UPDATE_SSA_TYPE(tmp, ssa_op->result_def);
2647
ext/opcache/tests/opt/inference_005.phpt
@@ -0,0 +1,16 @@
1
+--TEST--
2
+Type inference 005: Use MAY_BE_NULL result (insted of empty) for ASSIGN_DIM with invalid arguments
3
+--INI--
4
+opcache.enable=1
5
+opcache.enable_cli=1
6
+opcache.optimization_level=-1
7
+--FILE--
8
+<?php
9
+function foo() {
10
+ $a = $r[] = $r = [] & $y;
11
+ +list(&$y) = $a;
12
+}
13
+?>
14
+DONE
15
+--EXPECT--
16
0 commit comments