Documentación offline PHP master

ReflectionMethod::getPrototype

master Ver versión oficial en línea Licencia CC-BY-3.0Descargado el 2026-08-02

En esta página

ReflectionMethod::getPrototype

Obtiene el prototipo del método (si existe)

Descripción#

public ReflectionMethod::getPrototype(): ReflectionMethod
```php

Devuelve el prototipo del método.

## Parámetros

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

## Valores devueltos

Un objeto `ReflectionMethod` instancia del método.

## Errores/Excepciones

Se lanzará una excepción `ReflectionException` si el método no posee un prototipo.

## Ejemplos

Ejemplo con ReflectionMethod::getPrototype
getPrototype()); ?>

```php

El ejemplo anterior mostrará:

object(ReflectionMethod)#2 (2) {
  ["name"]=>
  string(10) "sayHelloTo"
  ["class"]=>
  string(5) "Hello"
}

Véase también#

ReflectionMethod::getModifiers, ReflectionMethod::hasPrototype