diff options
| author | Antony Dovgal <tony2001@php.net> | 2006-10-02 12:16:35 +0000 |
|---|---|---|
| committer | Antony Dovgal <tony2001@php.net> | 2006-10-02 12:16:35 +0000 |
| commit | c356ad3b65709d41c2b5030c252bc54b7295daa3 (patch) | |
| tree | 254c98c28a1a47c5177d6d9d6be94734648e195e /ext/reflection/tests | |
| parent | 2b1b2db8ec8d5ef26da2ec671d163182f72f1206 (diff) | |
| download | php-git-c356ad3b65709d41c2b5030c252bc54b7295daa3.tar.gz | |
MFH: #39001 (ReflectionProperty returns incorrect declaring class for protected properties)
Diffstat (limited to 'ext/reflection/tests')
| -rw-r--r-- | ext/reflection/tests/bug39001.phpt | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/ext/reflection/tests/bug39001.phpt b/ext/reflection/tests/bug39001.phpt new file mode 100644 index 0000000000..1ed675f029 --- /dev/null +++ b/ext/reflection/tests/bug39001.phpt @@ -0,0 +1,27 @@ +--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 |
