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.
28 lines
387 B
28 lines
387 B
--TEST--
|
|
SSA object prop: loop body object redefinition prevents hoisting
|
|
--FILE--
|
|
<?php
|
|
class Foo {
|
|
public int $a;
|
|
}
|
|
|
|
function readFoo(Foo $foo): int {
|
|
return $foo->a;
|
|
}
|
|
|
|
function main(): void {
|
|
$o = new Foo();
|
|
$o->a = 1;
|
|
|
|
$n = 1;
|
|
while ($n--) {
|
|
$o = new Foo();
|
|
$o->a = 5;
|
|
}
|
|
|
|
$o->a += 1;
|
|
var_dump(readFoo($o));
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
int(6)
|
|
|