3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr = array("test",array("one"=>1,"two"=>2,"three"=>3), array("one"=>1,"two"=>2,"three"=>3)); $o = new ArrayObject($arr); echo $o->offsetGet('three'),"\n"; foreach ($o as $key=>$val){ if (is_array($val)) { foreach($val as $k => $v) { echo $k . ' => ' . $v,"\n"; } } else { echo $val,"\n"; } }
based on 7fA1M
Output for 5.4.8 - 7.1.0
Notice: Undefined index: three in /in/WLeqF on line 4 test one => 1 two => 2 three => 3 one => 1 two => 2 three => 3
Output for 5.0.0 - 5.4.7
Notice: Undefined index: three in /in/WLeqF on line 4 test one => 1 two => 2 three => 3 one => 1 two => 2 three => 3
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: arrayobject in /in/WLeqF on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: arrayobject in /in/WLeqF on line 3