- var_dump: documentation ( source)
<?php
class Thing extends ArrayObject
{
public function __construct(array $data) {
parent::__construct($data, self::ARRAY_AS_PROPS);
}
public function offsetSet($index, $value) {
parent::offsetSet($index, $value);
return $this;
}
public function offsetGet($index) {
if ($this->offsetExists($index)) {
return parent::offsetGet($index);
}
return null;
}
}
$test = new Thing([]);
$test->dynamic['key'] = ['is-set' => 'up to 7.1.3'];
var_dump($test);