ReflectionFunctionAbstract::getTentativeReturnType

(PHP 8 >= 8.1.0)

ReflectionFunctionAbstract::getTentativeReturnTypeReturns the tentative return type associated with the function

Açıklama

publicReflectionFunctionAbstract::getTentativeReturnType(): ?ReflectionType

Returns the tentative return type associated with the function.

Bağımsız Değişkenler

Bu işlevin bağımsız değişkeni yoktur.

Dönen Değerler

Returns a ReflectionType object if a tentative return type is specified, null otherwise.

Örnekler

Örnek 1 ReflectionFunctionAbstract::getTentativeReturnType() example

<?php

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

Yukarıdaki örnek şuna benzer bir çıktı üretir:

object(ReflectionNamedType)#2 (0) { }

Ayrıca Bakınız

To Top