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.
 
 

32 lines
579 B

--TEST--
class static
--FILE--
<?php
namespace Test {
#[AllowDynamicProperties]
class Worker
{
public const FOO = 'foo';
protected static string $hello;
public function __construct()
{
self::$hello = 'hello';
var_dump(self::$hello);
static::$hello = 'world';
var_dump(static::$hello);
var_dump(static::FOO);
}
}
}
namespace {
function main()
{
$obj = new \Test\Worker();
}
}
?>
--EXPECT--
string(5) "hello"
string(5) "world"
string(3) "foo"