xref: /PHP-8.4/ext/opcache/tests/jit/cmp_009.phpt (revision c16ad918)
1--TEST--
2JIT CMP: 009 Wrong code generation for dead compare
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.file_update_protection=0
7--FILE--
8<?php
9function test() {
10	$j = 0;
11    for ($i = 0; $i < 20; $j++) {
12    $a&=
13    $a = $a.+
14    $tojenthiss[$i = $v] = $s=
15    $tojenthiss[$i = $v] = $s=
16    $a&=
17    $b =
18    $b =
19    $a = $a.+
20$obj->prop =
21    $a = $a.+
22$obj->prop =
23    $a = $a.+
24    $Sojenthiss[$i = $v] = $s=
25    $x!= $a ?: $c;
26    $x!= $a ?: $c;
27    $x!= $a ?: $c;
28    $x!= $a ?: $c;
29    $aZ = $a;
30    $aZ = $a;
31    $aZ = $a;
32    $a = $a.+
33    $a = $a.+
34    $x!= $a ?: $c;
35    $aZ = $a;
36    $a = $a.+
37    $a = $a.+
38$obj->prop =
39    $a = $a.+
40    $Sojenthiss[$i = $v] = $s=
41    $x!= $a ?: $c;
42    $x!= $a ?: $c;
43    $aZ = $a;
44    }
45}
46@test();
47?>
48--EXPECTF--
49Fatal error: Uncaught Error: Attempt to assign property "prop" on null in %scmp_009.php:15
50Stack trace:
51#0 %scmp_009.php(39): test()
52#1 {main}
53  thrown in %scmp_009.php on line 15
54