File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -1100,6 +1100,9 @@ static zend_string* ZEND_FASTCALL zend_jit_fetch_dim_str_r_helper(zend_string *s
1100
1100
} else {
1101
1101
offset = Z_LVAL_P (dim );
1102
1102
}
1103
+ if (UNEXPECTED (EG (exception ) != NULL )) {
1104
+ return ZSTR_EMPTY_ALLOC ();
1105
+ }
1103
1106
return zend_jit_fetch_dim_str_offset (str , offset );
1104
1107
}
1105
1108
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ GH-12723: Function JIT emits "Uninitialized string offset" warning at the same time as invalid offset Error
3
+ --INI--
4
+ opcache.enable=1
5
+ opcache.enable_cli=1
6
+ --FILE--
7
+ <?php
8
+
9
+ $ container = '' ;
10
+ $ dimension = [];
11
+
12
+ try {
13
+ var_dump ($ container [$ dimension ]);
14
+ } catch (\Throwable $ e ) {
15
+ echo $ e ->getMessage (), "\n" ;
16
+ }
17
+
18
+ ?>
19
+ --EXPECT--
20
+ Cannot access offset of type array on string
You can’t perform that action at this time.
0 commit comments