mirror of
https://github.com/php/php-src.git
synced 2024-10-21 00:12:34 +00:00
28 lines
503 B
Plaintext
28 lines
503 B
Plaintext
|
--TEST--
|
||
|
Bug #39001 (ReflectionProperty returns incorrect declaring class for protected properties)
|
||
|
--FILE--
|
||
|
<?php
|
||
|
|
||
|
class Meta {
|
||
|
}
|
||
|
|
||
|
class CParent extends Meta {
|
||
|
public $publicVar;
|
||
|
protected $protectedVar;
|
||
|
}
|
||
|
|
||
|
class Child extends CParent {
|
||
|
}
|
||
|
|
||
|
$r = new ReflectionClass('Child');
|
||
|
|
||
|
var_dump($r->getProperty('publicVar')->getDeclaringClass()->getName());
|
||
|
var_dump($r->getProperty('protectedVar')->getDeclaringClass()->getName());
|
||
|
|
||
|
echo "Done\n";
|
||
|
?>
|
||
|
--EXPECTF--
|
||
|
string(7) "CParent"
|
||
|
string(7) "CParent"
|
||
|
Done
|