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){ echo $key . ' => ' . $val, "\n"; }
based on 3LMkf
Output for 5.4.8 - 7.1.0
Notice: Undefined index: three in /in/7fA1M on line 4 0 => test Notice: Array to string conversion in /in/7fA1M on line 6 1 => Array Notice: Array to string conversion in /in/7fA1M on line 6 2 => Array
Output for 5.4.0 - 5.4.7
Notice: Undefined index: three in /in/7fA1M on line 4 0 => test Notice: Array to string conversion in /in/7fA1M on line 6 1 => Array Notice: Array to string conversion in /in/7fA1M on line 6 2 => Array
Output for 5.0.0 - 5.3.29
Notice: Undefined index: three in /in/7fA1M on line 4 0 => test 1 => Array 2 => Array
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: arrayobject in /in/7fA1M 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/7fA1M on line 3