TypePHP 编译器 https://swoole.com/aot/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

26 lines
542 B

--TEST--
Static property native slot becomes invalid after dynamic reference binding
--FILE--
<?php
use native_types;
class StaticRefSlotCrash {
public static int $i = 1;
}
function main(): void {
StaticRefSlotCrash::$i = 12;
var_dump(StaticRefSlotCrash::$i);
eval('function bind_static_ref(): void { $ref =& StaticRefSlotCrash::$i; $ref = 99; }');
bind_static_ref();
var_dump(StaticRefSlotCrash::$i);
StaticRefSlotCrash::$i += 1;
var_dump(StaticRefSlotCrash::$i);
}
?>
--EXPECT--
int(12)
int(99)
int(100)