1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 16:22:37 +01:00
Files
archived-php-src/ext/reflection/tests/bug79487.phpt
Christoph M. Becker ef2130db88 Fix #79487: ::getStaticProperties() ignores property modifications
When retrieving the static class properties via reflection, we have to
cater to possible modifications.
2020-06-24 10:05:51 +02:00

35 lines
549 B
PHP

--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"
}