xref: /PHP-8.2/ext/opcache/tests/jit/assign_053.phpt (revision 3a8912fb)
1--TEST--
2JIT ASSIGN: memory leak
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
11class Test {
12    public string $x;
13}
14$test=new Test;
15$test->x = " $y ";
16$r = &$test->x + ($r = $y);
17?>
18--EXPECTF--
19Warning: Undefined variable $y in %sassign_053.php on line 6
20
21Warning: Undefined variable $y in %sassign_053.php on line 7
22
23Fatal error: Uncaught TypeError: Cannot assign null to reference held by property Test::$x of type string in %sassign_053.php:7
24Stack trace:
25#0 {main}
26  thrown in %sassign_053.php on line 7