- 添加静态属性列表存储和初始化机制 - 实现 self 关键字解析为带命名空间的类名 - 在扩展模板中添加静态属性设置代码生成 - 支持构造函数的参数传递和属性初始化 - 过滤抽象方法避免不必要的解析处理 - 添加 bool 类型和构造函数相关的测试用例pull/1/head
parent
dac3fa81e8
commit
4d0a44fdbd
5 changed files with 80 additions and 8 deletions
@ -0,0 +1,13 @@ |
||||
--TEST-- |
||||
bool 001 |
||||
--FILE-- |
||||
<?php |
||||
function main() |
||||
{ |
||||
$offset = 1; |
||||
$maxCount = any(10); |
||||
var_dump($maxCount-- > 0 && $offset); |
||||
} |
||||
?> |
||||
--EXPECT-- |
||||
bool(true) |
||||
@ -0,0 +1,39 @@ |
||||
--TEST-- |
||||
ctor |
||||
--FILE-- |
||||
<?php |
||||
namespace Test { |
||||
#[AllowDynamicProperties] |
||||
class Worker |
||||
{ |
||||
protected static array $globalStatistics = [ |
||||
'start_timestamp' => 0, |
||||
'worker_exit_info' => [] |
||||
]; |
||||
public ?string $workerId = null; |
||||
public function __construct(?string $socketName = null) |
||||
{ |
||||
$this->workerId = spl_object_hash($this); |
||||
var_dump($socketName); |
||||
var_dump(self::$globalStatistics); |
||||
} |
||||
} |
||||
} |
||||
namespace { |
||||
function main() |
||||
{ |
||||
$obj = new \Test\Worker("hello"); |
||||
var_dump($obj->workerId); |
||||
} |
||||
} |
||||
?> |
||||
--EXPECT-- |
||||
string(5) "hello" |
||||
array(2) { |
||||
["start_timestamp"]=> |
||||
int(0) |
||||
["worker_exit_info"]=> |
||||
array(0) { |
||||
} |
||||
} |
||||
string(32) "00000000000000010000000000000000" |
||||
Loading…
Reference in new issue