PHP 8.5.0 Alpha 2 available for testing

ReflectionFunctionAbstract::hasTentativeReturnType

(PHP 8 >= 8.1.0)

ReflectionFunctionAbstract::hasTentativeReturnTypeIndica si la función tiene un tipo de retorno provisional

Descripción

public ReflectionFunctionAbstract::hasTentativeReturnType(): bool

Indica si la función tiene un tipo de retorno provisional.

Parámetros

Esta función no contiene ningún parámetro.

Valores devueltos

Devuelve true si la función tiene un tipo de retorno provisional, de lo contrario false.

Ejemplos

Ejemplo #1 Ejemplo de ReflectionFunctionAbstract::hasTentativeReturnType()

<?php

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

El ejemplo anterior mostrará :

bool(true)

Ver también

add a note

User Contributed Notes

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