CakeFest 2024: The Official CakePHP Conference

ReflectionMethod::getPrototype

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

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

Açıklama

public ReflectionMethod::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

add a note

User Contributed Notes

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