xref: /PHP-8.4/ext/reflection/tests/bug79487.phpt (revision ef2130db)
1--TEST--
2Bug #79487 (::getStaticProperties() ignores property modifications)
3--FILE--
4<?php
5class Foo {
6    public static $bar = 'orig';
7}
8
9Foo::$bar = 'new';
10$rc = new ReflectionClass('Foo');
11var_dump($rc->getStaticProperties());
12
13class A {
14  public static $a = 'A old';
15}
16class B extends A {
17  public static $b = 'B old';
18}
19
20$rc = new ReflectionClass(B::class);
21A::$a = 'A new';
22var_dump($rc->getStaticProperties());
23?>
24--EXPECT--
25array(1) {
26  ["bar"]=>
27  string(3) "new"
28}
29array(2) {
30  ["b"]=>
31  string(5) "B old"
32  ["a"]=>
33  string(5) "A new"
34}
35