php-8.0.30-src/ext/opcache/tests/jit/assign_obj_op_002.phpt

32 lines
473 B
PHP

--TEST--
JIT ASSIGN_OBJ_OP: memory leak
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.file_update_protection=0
opcache.jit_buffer_size=1M
--FILE--
<?php
class A {
public string $prop = "222";
}
class B {
public function __toString() {
global $a;
$a->prop .= $a->prop . "leak";
return "test";
}
}
$a = new A;
$prop = &$a->prop;
$a->prop = new B;
var_dump($a);
?>
--EXPECT--
object(A)#1 (1) {
["prop"]=>
&string(4) "test"
}