Skip to content

Commit 5ac55af

Browse files
committed
Add test for bug #80564
This has also been fixed by 3eb97a4.
1 parent 3eb97a4 commit 5ac55af

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ PHP NEWS
1010
- Reflection:
1111
. Fixed bug #80821 (ReflectionProperty::getDefaultValue() returns current
1212
value for statics). (Nikita)
13+
. Fixed bug #80564 (ReflectionProperty::__toString() renders current value,
14+
not default value). (Nikita)
1315

1416
22 Jul 2021, PHP 8.1.0beta1
1517

ext/reflection/tests/bug80564.phpt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
--TEST--
2+
Bug #80564: ReflectionProperty::__toString() renders current value, not default value
3+
--FILE--
4+
<?php
5+
6+
class A {
7+
public static $x = 'default';
8+
}
9+
10+
A::$x = new stdClass;
11+
12+
$rp = new ReflectionProperty('A', 'x');
13+
echo $rp;
14+
15+
?>
16+
--EXPECT--
17+
Property [ public static $x = 'default' ]

0 commit comments

Comments
 (0)