3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $obj = new stdClass; $obj->foo = 'bar'; $obj->bar = array('a', 'b'); $a = new ArrayObject($obj); foreach ($a as $prop) { var_dump($prop); }
Output for 5.0.0 - 7.1.0
string(3) "bar" array(2) { [0]=> string(1) "a" [1]=> string(1) "b" }
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: arrayobject in /in/2JB0u on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: arrayobject in /in/2JB0u on line 6