3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function iter(iterable $input) { foreach ($input as $key => $val) { echo "[$key] = '{$val}'\n"; } } iter(new ArrayObject(["one" => "1", "two" => "2"]));
Output for 7.1.0 - 7.3.0alpha1
[one] = '1' [two] = '2'
Output for 7.0.30
Fatal error: Uncaught TypeError: Argument 1 passed to iter() must be an instance of iterable, instance of ArrayObject given, called in /in/ZCJhh on line 9 and defined in /in/ZCJhh:3 Stack trace: #0 /in/ZCJhh(9): iter(Object(ArrayObject)) #1 {main} thrown in /in/ZCJhh on line 3
Process exited with code 255.
Output for hhvm-3.22.0
Fatal error: Uncaught TypeError: Argument 1 passed to iter() must be an instance of iterable, ArrayObject given in /in/ZCJhh:-1 Stack trace: #0 /in/ZCJhh(-1): iter() #1 {main}
Process exited with code 255.
Output for hhvm-3.18.5 - 3.21.3
Fatal error: Uncaught TypeError: Argument 1 passed to iter() must be an instance of iterable, ArrayObject given in /in/ZCJhh:7 Stack trace: #0 /in/ZCJhh(9): iter() #1 {main}
Process exited with code 255.
Output for 5.6.30
Catchable fatal error: Argument 1 passed to iter() must be an instance of iterable, instance of ArrayObject given, called in /in/ZCJhh on line 9 and defined in /in/ZCJhh on line 3
Process exited with code 255.