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.
 
 

29 lines
410 B

--TEST--
SSA object prop: object argument can turn property slot into reference
--FILE--
<?php
use native_types;
class RefSlotFoo {
public int $a;
}
function bind_ref(RefSlotFoo $o): void {
$ref =& $o->a;
$ref = 99;
}
function main(): void {
$o = new RefSlotFoo();
$o->a = 1;
bind_ref($o);
var_dump($o->a);
$o->a += 1;
var_dump($o->a);
}
?>
--EXPECT--
int(99)
int(100)