- 重构 checkAccessible 方法,正确处理 private 和 protected 方法的访问控制 - 添加对受保护方法的继承关系检查 - 修复当前类内部访问权限判断逻辑 - 优化 findNativeMethod 中的对象方法查找流程 - 添加缺失的返回值处理逻辑pull/1/head
parent
69a1c24610
commit
492a1dbd39
2 changed files with 47 additions and 13 deletions
@ -0,0 +1,28 @@ |
||||
--TEST-- |
||||
class const 001 |
||||
--FILE-- |
||||
<?php |
||||
class WorkerA |
||||
{ |
||||
protected function foo(string $name, string &$value) { |
||||
$value = 'hello ' . $name; |
||||
} |
||||
} |
||||
|
||||
class WorkerB extends WorkerA |
||||
{ |
||||
public function bar(string $name) { |
||||
$value = ''; |
||||
$this->foo($name, $value); |
||||
return $value; |
||||
} |
||||
} |
||||
|
||||
function main() |
||||
{ |
||||
$o = new WorkerB; |
||||
var_dump($o->bar('php')); |
||||
} |
||||
?> |
||||
--EXPECT-- |
||||
string(9) "hello php" |
||||
Loading…
Reference in new issue