xref: /PHP-8.1/ext/opcache/tests/jit/assign_051.phpt (revision 7e8257fb)
1--TEST--
2JIT ASSIGN: incorrect assignment optimization
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.file_update_protection=0
7opcache.jit_buffer_size=1M
8opcache.protect_memory=1
9--FILE--
10<?php
11function foo(int $a) {
12    $arr = $a[] = (y);
13    $arr = y;
14    $c = $y = $arr = &y($c);
15}
16foo(0);
17?>
18--EXPECTF--
19Fatal error: Uncaught Error: Undefined constant "y" in %sassign_051.php:3
20Stack trace:
21#0 %sassign_051.php(7): foo(0)
22#1 {main}
23  thrown in %sassign_051.php on line 3
24