diff options
Diffstat (limited to 'ext/reflection/tests')
-rw-r--r-- | ext/reflection/tests/bug79487.phpt | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/ext/reflection/tests/bug79487.phpt b/ext/reflection/tests/bug79487.phpt new file mode 100644 index 0000000000..5185c98bba --- /dev/null +++ b/ext/reflection/tests/bug79487.phpt @@ -0,0 +1,34 @@ +--TEST-- +Bug #79487 (::getStaticProperties() ignores property modifications) +--FILE-- +<?php +class Foo { + public static $bar = 'orig'; +} + +Foo::$bar = 'new'; +$rc = new ReflectionClass('Foo'); +var_dump($rc->getStaticProperties()); + +class A { + public static $a = 'A old'; +} +class B extends A { + public static $b = 'B old'; +} + +$rc = new ReflectionClass(B::class); +A::$a = 'A new'; +var_dump($rc->getStaticProperties()); +?> +--EXPECT-- +array(1) { + ["bar"]=> + string(3) "new" +} +array(2) { + ["b"]=> + string(5) "B old" + ["a"]=> + string(5) "A new" +} |