(PHP 8 >= 8.1.0)
ReflectionFunctionAbstract::hasTentativeReturnType — Returns whether the function has a tentative return type
public ReflectionFunctionAbstract::hasTentativeReturnType(): bool
Returns whether the function has a tentative return type.
This function has no parameters.
Example #1 ReflectionFunctionAbstract::hasTentativeReturnType() example
<?php $method = new ReflectionMethod(\ArrayAccess::class, 'offsetGet'); var_dump($method->hasTentativeReturnType());
The above example will output:
bool(true)
© 1997–2025 The PHP Documentation Group
Licensed under the Creative Commons Attribution License v3.0 or later.
https://www.php.net/manual/en/reflectionfunctionabstract.hastentativereturntype.php