3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Base extends ArrayObject{ var $parent = true; var $another_prop = 123; public function __construct() { $this['test'] = 123; } public function __debugInfo() { return [ 'parent'=>$this->getArrayCopy() ]; } } class Child extends Base { var $parent = false; } var_dump(new Child());
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
Deprecated: Return type of Base::__debugInfo() should either be compatible with ArrayObject::__debugInfo(): array, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/ddq2i on line 9 object(Child)#1 (1) { ["parent"]=> array(1) { ["test"]=> int(123) } }
Output for 7.4.6 - 7.4.33, 8.0.0 - 8.0.30
object(Child)#1 (1) { ["parent"]=> array(1) { ["test"]=> int(123) } }
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.34, 7.3.0 - 7.3.33, 7.4.0 - 7.4.5
object(Child)#1 (3) { ["parent"]=> bool(false) ["another_prop"]=> int(123) ["storage":"ArrayObject":private]=> array(1) { ["test"]=> int(123) } }

preferences:
260.29 ms | 403 KiB | 339 Q