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