- 在方法调用前添加变量类型检查,防止对非对象类型调用方法 - 修复反射中获取方法返回类型的逻辑,改进变量命名避免冲突 - 添加对字符串类型参数调用对象方法的错误检测和提示pull/1/head
parent
2d0baeaea9
commit
eba8964d34
3 changed files with 24 additions and 5 deletions
@ -0,0 +1,15 @@ |
|||||||
|
<?php |
||||||
|
function bar(): stdClass |
||||||
|
{ |
||||||
|
return new stdClass(); |
||||||
|
} |
||||||
|
function foo(string $o) |
||||||
|
{ |
||||||
|
$o2 = bar(); |
||||||
|
$o2->call(); |
||||||
|
} |
||||||
|
|
||||||
|
function main() |
||||||
|
{ |
||||||
|
foo("hello"); |
||||||
|
} |
||||||
Loading…
Reference in new issue