3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $iterable = new stdClass; is_array($iterable) ? $iterable : iterator_to_array($iterable);
Output for 7.0.30 - 7.3.1
Fatal error: Uncaught TypeError: Argument 1 passed to iterator_to_array() must implement interface Traversable, instance of stdClass given in /in/92r6a:4 Stack trace: #0 /in/92r6a(4): iterator_to_array(Object(stdClass)) #1 {main} thrown in /in/92r6a on line 4
Process exited with code 255.
Output for hhvm-3.22.0
Fatal error: Uncaught Error: Argument must implement interface Traversable in /in/92r6a:-1 Stack trace: #0 /in/92r6a(-1): iterator_to_array() #1 {main}
Process exited with code 255.
Output for hhvm-3.21.3
Fatal error: Uncaught Error: Argument must implement interface Traversable in /in/92r6a:4 Stack trace: #0 /in/92r6a(4): iterator_to_array() #1 {main}
Process exited with code 255.
Output for hhvm-3.18.5
Fatal error: Uncaught Error: Argument must implement interface Traversable in /in/92r6a:4 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.30 - 5.6.38
Catchable fatal error: Argument 1 passed to iterator_to_array() must implement interface Traversable, instance of stdClass given in /in/92r6a on line 4
Process exited with code 255.