PHP 8.5.0 Alpha 2 available for testing

ReflectionMethod::hasPrototype

(PHP 8 >= 8.2.0)

ReflectionMethod::hasPrototypeIndica si el método tiene un prototipo

Descripción

public ReflectionMethod::hasPrototype(): bool

Indica si el método tiene un prototipo.

Parámetros

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

Valores devueltos

Devuelve true si el método tiene un prototipo, de lo contrario false.

Ejemplos

Ejemplo #1 Ejemplo con ReflectionMethod::hasPrototype()

<?php

class Hello
{
public function
sayHelloTo($name)
{
return
'Hello '.$name;
}
}

class
HelloWorld extends Hello
{
public function
sayHelloTo($name)
{
return
'Hello world: '.$name;
}
}
$reflectionMethod = new ReflectionMethod('HelloWorld', 'sayHelloTo');
var_dump($reflectionMethod->hasPrototype());
?>

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