- 在 CompilerBase.php 中添加了对 self 类型的处理逻辑 - 将 self 类型的对象添加到对象映射中 - 添加了静态类属性读写测试用例 - 测试验证了 self 类型在静态上下文中的正确行为pull/1/head
parent
eed45fdb61
commit
afc4ef87f8
2 changed files with 24 additions and 0 deletions
@ -0,0 +1,21 @@ |
||||
--TEST-- |
||||
Static Class Property Read/Write Test |
||||
--FILE-- |
||||
<?php |
||||
class Worker |
||||
{ |
||||
public static ?stdClass $event = null; |
||||
public static string $eventLoopClass = 'Select'; |
||||
|
||||
public static function init() { |
||||
static::$eventLoopClass = static::$event ?: static::$eventLoopClass; |
||||
var_dump(static::$eventLoopClass); |
||||
} |
||||
} |
||||
|
||||
function main() { |
||||
Worker::init(); |
||||
} |
||||
?> |
||||
--EXPECT-- |
||||
string(6) "Select" |
||||
Loading…
Reference in new issue