You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

30 lines
474 B

--TEST--
ReflectionMethod::getDeclaringClass()
--FILE--
<?php
class A {
function foo() {}
}
class B extends A {
function bar() {}
}
$methodInfo = new ReflectionMethod('B', 'foo');
var_dump($methodInfo->getDeclaringClass());
$methodInfo = new ReflectionMethod('B', 'bar');
var_dump($methodInfo->getDeclaringClass());
?>
--EXPECTF--
object(ReflectionClass)#%d (1) {
["name"]=>
string(1) "A"
}
object(ReflectionClass)#%d (1) {
["name"]=>
string(1) "B"
}