PHP 8.6.0 Beta 1 is available for testing

ReflectionMethod::hasPrototype

(PHP 8 >= 8.2.0)

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

Descripción

public function 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)

Véase también

Found A Problem?

Learn How To Improve This PageSubmit a Pull RequestReport a Bug
+add a note

User Contributed Notes

There are no user contributed notes for this page.

AltStyle によって変換されたページ (->オリジナル) /