PHP 7.2.0 Beta 3 Released


(PHP 5)

ReflectionMethod::getDeclaringClassGets declaring class for the reflected method.


public ReflectionClass ReflectionMethod::getDeclaringClass ( void )

Gets the declaring class for the reflected method.

Elenco dei parametri

Questa funzione non contiene parametri.

Valori restituiti

A ReflectionClass object of the class that the reflected method is part of.


Example #1 ReflectionMethod::getDeclaringClass() example

class HelloWorld {

    protected function 
sayHelloTo($name) {
'Hello ' $name;


$reflectionMethod = new ReflectionMethod(new HelloWorld(), 'sayHelloTo');

Il precedente esempio visualizzerĂ :

object(ReflectionClass)#2 (1) {
  string(10) "HelloWorld"

Vedere anche:

add a note add a note

User Contributed Notes

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