mirror of
https://github.com/php/php-src.git
synced 2024-11-24 18:34:21 +08:00
28 lines
520 B
PHP
28 lines
520 B
PHP
--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());
|
|
|
|
echo "Wrong number of params:\n";
|
|
$propInfo->getDeclaringClass(1);
|
|
|
|
?>
|
|
--EXPECTF--
|
|
object(ReflectionClass)#%d (1) {
|
|
["name"]=>
|
|
string(1) "A"
|
|
}
|
|
Wrong number of params:
|
|
|
|
Warning: ReflectionProperty::getDeclaringClass() expects exactly 0 parameters, 1 given in %s on line %d
|