php8.5
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

Source: reference/reflection/reflectionfunctionabstract/hastentativereturntype.xml · from the official PHP manual (php/doc-en)