Home/
Manual/
reflection / reflectionfunctionabstract/ ReflectionFunctionAbstract::hasTentativeReturnType
ReflectionFunctionAbstract::hasTentativeReturnType
PHP function
Edit on GitHub ✎
(PHP 8 >= 8.1.0)
Returns whether the function has a tentative return type
Description
ReflectionFunctionAbstract::hasTentativeReturnType(): bool
Returns whether the function has a tentative return type.
Parameters Parameters
Return Values
Returns true if the function has a tentative return type, otherwise false.
Examples
ReflectionFunctionAbstract::hasTentativeReturnType example
php
<?php
$method = new ReflectionMethod(\ArrayAccess::class, 'offsetGet');
var_dump($method->hasTentativeReturnType());The above example will output:
output
bool(true)See Also
ReflectionFunctionAbstract::getTentativeReturnTypeReflectionFunctionAbstract::hasReturnType- Return Type Compatibility with Internal Classes