Php/docs/reflectionmethod.getdeclaringclass
From Get docs
ReflectionMethod::getDeclaringClass
(PHP 5, PHP 7)
ReflectionMethod::getDeclaringClass — Gets declaring class for the reflected method
Description
public ReflectionMethod::getDeclaringClass ( ) : ReflectionClass
Gets the declaring class for the reflected method.
Parameters
This function has no parameters.
Examples
Example #1 ReflectionMethod::getDeclaringClass() example
<?phpclass HelloWorld { protected function sayHelloTo($name) { return 'Hello ' . $name; }}$reflectionMethod = new ReflectionMethod(new HelloWorld(), 'sayHelloTo');var_dump($reflectionMethod->getDeclaringClass());?>
The above example will output:
object(ReflectionClass)#2 (1) { ["name"]=> string(10) "HelloWorld" }