diff options
Diffstat (limited to 'ext/reflection/tests/bug48336.phpt')
-rw-r--r-- | ext/reflection/tests/bug48336.phpt | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/ext/reflection/tests/bug48336.phpt b/ext/reflection/tests/bug48336.phpt new file mode 100644 index 0000000000..ee90675f0c --- /dev/null +++ b/ext/reflection/tests/bug48336.phpt @@ -0,0 +1,44 @@ +--TEST-- +Bug #48286 (ReflectionProperty::getDeclaringClass() does not work with redeclared properties) +--FILE-- +<?php +class A { +} + +class B extends A { + static protected $prop; +} + +class C extends B { + static protected $prop; +} + +class D extends C { +} + +class E extends D { +} + +class F extends E { + static protected $prop; +} + +$class = 'A'; +for($class = 'A'; $class <= 'F'; $class ++) { + print($class.' => '); + try { + $rp = new ReflectionProperty($class, 'prop'); + print($rp->getDeclaringClass()->getName()); + } catch(Exception $e) { + print('N/A'); + } + print("\n"); +} +?> +--EXPECT-- +A => N/A +B => B +C => C +D => C +E => C +F => F |