- 在 CompilerBase.php 中添加 ltrim 函数移除命名空间前导反斜杠 - 为私有属性访问添加新的测试用例 private-prop-001.phpt - 测试验证静态类属性读写功能的正确性pull/1/head
parent
c259d20562
commit
af5442f25e
2 changed files with 30 additions and 1 deletions
@ -0,0 +1,29 @@ |
||||
--TEST-- |
||||
Static Class Property Read/Write Test |
||||
--FILE-- |
||||
<?php |
||||
class Select { |
||||
private $errorHandler = null; |
||||
public function setErrorHandler($errorHandler): void |
||||
{ |
||||
$this->errorHandler = $errorHandler; |
||||
var_dump($this->errorHandler); |
||||
} |
||||
} |
||||
|
||||
class Worker |
||||
{ |
||||
public static ?stdClass $globalEvent = null; |
||||
|
||||
public static function init() { |
||||
self::$globalEvent = new Select; |
||||
self::$globalEvent->setErrorHandler('test'); |
||||
} |
||||
} |
||||
|
||||
function main() { |
||||
Worker::init(); |
||||
} |
||||
?> |
||||
--EXPECT-- |
||||
string(4) "test" |
||||
Loading…
Reference in new issue