summaryrefslogtreecommitdiff
path: root/ext/reflection/tests/bug79487.phpt
blob: 5185c98bba907a17a4c6f2342537538b99fe297e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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"
}