- 在闭包中强制设置返回值类型为 var,避免类型推断错误 - 保持非闭包函数的原有返回值类型推断逻辑不变 - 添加测试用例验证静态调用场景下的返回值类型处理pull/1/head
parent
7b4eeefb19
commit
f56bd745e7
2 changed files with 34 additions and 8 deletions
@ -0,0 +1,19 @@ |
|||||||
|
--TEST-- |
||||||
|
static calls |
||||||
|
--FILE-- |
||||||
|
<?php |
||||||
|
|
||||||
|
function test(): void { |
||||||
|
set_error_handler(static function (int $code, string $msg, string $file, int $line): bool { |
||||||
|
return true; |
||||||
|
}); |
||||||
|
var_dump(__FUNCTION__); |
||||||
|
} |
||||||
|
|
||||||
|
function main() { |
||||||
|
$fn = 'test'; |
||||||
|
$fn(); |
||||||
|
} |
||||||
|
?> |
||||||
|
--EXPECT-- |
||||||
|
string(4) "test" |
||||||
Loading…
Reference in new issue