ReflectionFunctionAbstract::hasTentativeReturnType
(PHP 8 >= 8.1.0)
ReflectionFunctionAbstract::hasTentativeReturnType — Returns whether the function has a tentative return type
Description
Returns whether the function has a tentative return type.
Parameters
This function has no parameters.
Examples
Example #1 ReflectionFunctionAbstract::hasTentativeReturnType() example
<?php
$method = new ReflectionMethod(\ArrayAccess::class, 'offsetGet');
var_dump($method->hasTentativeReturnType());The above example will output:
bool(true)
See Also
- ReflectionFunctionAbstract::getTentativeReturnType() - Returns the tentative return type associated with the function
- ReflectionFunctionAbstract::hasReturnType() - Checks if the function has a specified return type
- Return Type Compatibility with Internal Classes
来源:PHP Documentation Group · 作者与贡献记录 · CC BY 3.0。离线整理了版式、链接和媒体显示。
