downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

ReflectionMethod::getModifiers> <ReflectionMethod::export
Last updated: Fri, 20 May 2011

view this page in

ReflectionMethod::getDeclaringClass

(PHP 5)

ReflectionMethod::getDeclaringClassGets declaring class for the reflected method.

Descripción

public ReflectionClass ReflectionMethod::getDeclaringClass ( void )

Gets the declaring class for the reflected method.

Parámetros

Esta función no tiene parámetros.

Valores devueltos

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

Ejemplos

Example #1 ReflectionMethod::getDeclaringClass() example

<?php
class HelloWorld {

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

}

$reflectionMethod = new ReflectionMethod(new HelloWorld(), 'sayHelloTo');
var_dump($reflectionMethod->getDeclaringClass());
?>

El resultado del ejemplo sería:

object(ReflectionClass)#2 (1) {
  ["name"]=>
  string(10) "HelloWorld"
}

Ver también



add a note add a note User Contributed Notes ReflectionMethod::getDeclaringClass
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites