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 38d50a9 commit de07248Copy full SHA for de07248
ext/opcache/tests/opt/gh10008.phpt
@@ -0,0 +1,27 @@
1
+--TEST--
2
+GH-10008 (Narrowing occurred during type inference of ZEND_ADD_ARRAY_ELEMENT)
3
+--INI--
4
+opcache.enable=1
5
+opcache.enable_cli=1
6
+opcache.optimization_level=0x20
7
+--EXTENSIONS--
8
+opcache
9
+--FILE--
10
+<?php
11
+function test()
12
+{
13
+ $bool_or_int = true;
14
+ while (a()) {
15
+ if ($bool_or_int !== true) {
16
+ // The following line (no longer) triggers narrowing during type inference of ZEND_ADD_ARRAY_ELEMENT.
17
+ $string_key = "a";
18
+ $array = ["bool_or_int" => $bool_or_int, $string_key => 123];
19
+ }
20
+
21
+ $bool_or_int = 0;
22
23
+}
24
+?>
25
+OK
26
+--EXPECT--
27
0 commit comments