- Output for 8.5.0
- bool(true)
object(ReflectionProperty)#3 (2) {
["name"]=>
string(5) "value"
["class"]=>
string(22) "ChildClassWithoutTrait"
}
object(ChildClassWithoutTrait)#2 (1) {
["value":protected]=>
int(20)
}
--------------------------------------------------------------------------------------------------------
bool(true)
object(ReflectionProperty)#2 (2) {
["name"]=>
string(5) "value"
["class"]=>
string(25) "ClassWithTraitAndNoParent"
}
object(ClassWithTraitAndNoParent)#1 (1) {
["value":protected]=>
int(20)
}
--------------------------------------------------------------------------------------------------------
bool(true)
object(ReflectionProperty)#1 (2) {
["name"]=>
string(5) "value"
["class"]=>
string(19) "ChildClassWithTrait"
}
object(ChildClassWithTrait)#4 (1) {
["value":protected]=>
int(20)
}
- Output for 8.4.1 - 8.4.15
- bool(true)
object(ReflectionProperty)#3 (2) {
["name"]=>
string(5) "value"
["class"]=>
string(22) "ChildClassWithoutTrait"
}
object(ChildClassWithoutTrait)#2 (1) {
["value":protected]=>
int(20)
}
--------------------------------------------------------------------------------------------------------
bool(true)
object(ReflectionProperty)#2 (2) {
["name"]=>
string(5) "value"
["class"]=>
string(25) "ClassWithTraitAndNoParent"
}
object(ClassWithTraitAndNoParent)#1 (1) {
["value":protected]=>
int(20)
}
--------------------------------------------------------------------------------------------------------
bool(true)
object(ReflectionProperty)#1 (2) {
["name"]=>
string(5) "value"
["class"]=>
string(11) "ParentClass"
}
object(ChildClassWithTrait)#4 (1) {
["value":protected]=>
int(20)
}
- Output for 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.28
- bool(true)
object(ReflectionProperty)#3 (2) {
["name"]=>
string(5) "value"
["class"]=>
string(22) "ChildClassWithoutTrait"
}
object(ChildClassWithoutTrait)#2 (1) {
["value":protected]=>
int(20)
}
--------------------------------------------------------------------------------------------------------
bool(true)
object(ReflectionProperty)#2 (2) {
["name"]=>
string(5) "value"
["class"]=>
string(25) "ClassWithTraitAndNoParent"
}
object(ClassWithTraitAndNoParent)#1 (1) {
["value":protected]=>
int(20)
}
--------------------------------------------------------------------------------------------------------
bool(true)
object(ReflectionProperty)#1 (2) {
["name"]=>
string(5) "value"
["class"]=>
string(11) "ParentClass"
}
Fatal error: Uncaught Error: Cannot initialize readonly property ParentClass::$value from scope ChildClassWithTrait in /in/Zbnqa:64
Stack trace:
#0 /in/Zbnqa(64): ReflectionProperty->setValue(Object(ChildClassWithTrait), 20)
#1 {main}
thrown in /in/Zbnqa on line 64
Process exited with code 255.