Dutch PHP Conference 2025 - Call For Papers

ReflectionFunctionAbstract::hasTentativeReturnType

(PHP 8 >= 8.1.0)

ReflectionFunctionAbstract::hasTentativeReturnTypeReturns whether the function has a tentative return type

Опис

public ReflectionFunctionAbstract::hasTentativeReturnType(): bool

Returns whether the function has a tentative return type.

Параметри

У цієї функції немає параметрів.

Значення, що повертаються

Returns true if the function has a tentative return type, otherwise false.

Приклади

Приклад #1 ReflectionFunctionAbstract::hasTentativeReturnType() example

<?php

$method
= new ReflectionMethod(\ArrayAccess::class, 'offsetGet');
var_dump($method->hasTentativeReturnType());

Поданий вище приклад виведе:

bool(true)

Прогляньте також

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top