(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.
Cette fonction ne contient aucun paramètre.
Returns true
if the function has a tentative return type, otherwise false
.
Exemple #1 ReflectionFunctionAbstract::hasTentativeReturnType() example
<?php
$method = new ReflectionMethod(\ArrayAccess::class, 'offsetGet');
var_dump($method->hasTentativeReturnType());
L'exemple ci-dessus va afficher :
bool(true)