3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class MyArrayObject extends ArrayObject { } $stack = new MyArrayObject; $stack['bar']['foo'] = "hello"; var_dump($stack);
Output for 5.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
object(MyArrayObject)#1 (1) { ["storage":"ArrayObject":private]=> array(1) { ["bar"]=> array(1) { ["foo"]=> string(5) "hello" } } }
Output for 5.2.7 - 5.2.17
object(MyArrayObject)#1 (1) { ["bar"]=> array(1) { ["foo"]=> string(5) "hello" } }
Output for 5.2.0 - 5.2.6
Notice: Undefined index: bar in /in/Uf2Qt on line 8 object(MyArrayObject)#1 (0) { }
Output for 5.0.0 - 5.1.6
Notice: Undefined index: bar in /in/Uf2Qt on line 8 Fatal error: Objects used as arrays in post/pre increment/decrement must return values by reference in /in/Uf2Qt on line 8
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Class myarrayobject: Cannot inherit from undefined class arrayobject in /in/Uf2Qt on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Class myarrayobject: Cannot inherit from undefined class arrayobject in /in/Uf2Qt on line 3