PHP - Manual: ReflectionFunctionAbstract::hasTentativeReturnType
2024-11-15
(PHP 8 >= 8.1.0)
ReflectionFunctionAbstract::hasTentativeReturnType — Returns whether the function has a tentative return type
Returns whether the function has a tentative return type.
此函数没有参数。
Returns true
if the function has a tentative return type, otherwise false
.
示例 #1 ReflectionFunctionAbstract::hasTentativeReturnType() example
<?php
$method = new ReflectionMethod(\ArrayAccess::class, 'offsetGet');
var_dump($method->hasTentativeReturnType());
以上例程会输出:
bool(true)
官方地址:https://www.php.net/manual/en/reflectionfunctionabstract.hastentativereturntype.php