php-src/ext/reflection/tests/ReflectionProperty_getDeclaringClass_variation1.phpt

22 lines
322 B
Plaintext
Raw Normal View History

--TEST--
Test ReflectionProperty::getDeclaringClass() with inherited properties.
--FILE--
<?php
class A {
public $prop;
}
class B extends A {
}
$propInfo = new ReflectionProperty('B', 'prop');
var_dump($propInfo->getDeclaringClass());
2018-09-16 17:16:42 +00:00
?>
--EXPECTF--
object(ReflectionClass)#%d (1) {
["name"]=>
string(1) "A"
}