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.
 
 

41 lines
648 B

--TEST--
Assign by reference to native typed static property (self / static / class name)
--FILE--
<?php
use native_types;
class Test
{
private static int $value = 123;
public static function abc(): void
{
$a = &self::$value;
var_dump($a);
$a = 456;
var_dump(self::$value);
$b = &static::$value;
var_dump($b);
$b = 789;
var_dump(static::$value);
$c = &Test::$value;
var_dump($c);
$c = 1000;
var_dump(Test::$value);
}
}
function main(): void
{
Test::abc();
}
?>
--EXPECT--
int(123)
int(456)
int(456)
int(789)
int(789)
int(1000)