3v4l.org

run code in 300+ PHP versions simultaneously
<?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);

preferences:
77.06 ms | 402 KiB | 5 Q