ReflectionMethod::getPrototype

(PHP 5 >= 5.1.2, PHP 7, PHP 8)

ReflectionMethod::getPrototypeYöntem bildirimini (varsa) döndürür

Açıklama

publicReflectionMethod::getPrototype(): void

Yöntem bildirimini döndürür.

Bağımsız Değişkenler

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

Dönen Değerler

Yöntem bildiriminin ReflectionMethod örneği.

Hatalar/İstisnalar

Yöntemin bir bildirimi yoksa bir ReflectionException istisnası oluşur.

Örnekler

Örnek 1 - ReflectionMethod::getPrototype() örneği

<?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->getPrototype());
?>

Yukarıdaki örneğin çıktısı:

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

Ayrıca Bakınız

To Top