<?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());
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)
}
}