3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $ao = new ArrayObject([2, 3, 8, 9]); var_dump(array_walk_recursive($ao->toArray(), function($item, $key){ echo $key . ' => ' . $item . PHP_EOL; }));
based on rsvbT
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to undefined method ArrayObject::toArray() in /in/16eku:5 Stack trace: #0 {main} thrown in /in/16eku on line 5
Process exited with code 255.
Output for 5.4.12 - 5.6.28
Fatal error: Call to undefined method ArrayObject::toArray() in /in/16eku on line 5
Process exited with code 255.
Output for 5.3.22 - 5.3.29
Parse error: syntax error, unexpected '[', expecting ')' in /in/16eku on line 3
Process exited with code 255.