php-src/ext/reflection/tests/bug48336.phpt
George Peter Banyard d8696f9216
[RFC] Path to Saner Increment/Decrement operators (#10358)
* Add behavioural tests for incdec operators

* Add support to ++/-- for objects castable to _IS_NUMBER

* Add str_increment() function

* Add str_decrement() function

RFC: https://wiki.php.net/rfc/saner-inc-dec-operators

Co-authored-by: Ilija Tovilo <ilija.tovilo@me.com>
Co-authored-by: Arnaud Le Blanc <arnaud.lb@gmail.com>
2023-07-17 15:51:24 +01:00

45 lines
652 B
PHP

--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;
}
$classes = ['A', 'B', 'C', 'D', 'E', 'F'];
foreach ($classes as $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