We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents fd8dfe1 + cbb9ee8 commit 222f751Copy full SHA for 222f751
1 file changed
ext/opcache/tests/jit/assign_obj_006.phpt
@@ -0,0 +1,37 @@
1
+--TEST--
2
+JIT ASSIGN_OBJ: violation of dominance
3
+--INI--
4
+opcache.enable=1
5
+opcache.enable_cli=1
6
+opcache.file_update_protection=0
7
+opcache.jit_buffer_size=1M
8
+--FILE--
9
+<?php
10
+class CacheItem {
11
+ protected mixed $value = null;
12
+}
13
+
14
+function test($value) {
15
+ $test = Closure::bind(
16
+ static function ($value) {
17
+ $item = new CacheItem();
18
+ if (\is_array($value) && \array_key_exists('value', $value)) {
19
+ $item->value = $value['value'];
20
+ }
21
+ return $item;
22
+ },
23
+ null,
24
+ CacheItem::class);
25
+ return $test($value);
26
27
28
+$values = [['value'=>'str'], ['value'=>'str'], ['value'=>42]];
29
+$n = count($values);
30
31
+for ($i = 0; $i < $n; $i++) {
32
+ test($values[$i]);
33
34
+?>
35
+OK
36
+--EXPECT--
37
0 commit comments