3v4l.org

run code in 200+ 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)) { $this[$index] = null; } return $this[$index]; } } $test = new Thing([]); $test->dynamic['key'] = ['is-set' => 'up to 7.1.3']; var_dump($test);
based on KVqfH
Output for 7.1.4 - 7.4.0

Process exited with code 139.
Output for 5.6.0 - 7.1.3
object(Thing)#1 (1) { ["storage":"ArrayObject":private]=> array(1) { ["dynamic"]=> array(1) { ["key"]=> array(1) { ["is-set"]=> string(11) "up to 7.1.3" } } } }