3v4l.org

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