3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = array( 'dingo', 'wombat', 'wallaby' ); $it = new ArrayIterator( $array ); print_r($it); print_r($array); echo array($it);
Output for 5.4.0 - 5.6.28, 7.0.0 - 7.1.0
ArrayIterator Object ( [storage:ArrayIterator:private] => Array ( [0] => dingo [1] => wombat [2] => wallaby ) ) Array ( [0] => dingo [1] => wombat [2] => wallaby ) Notice: Array to string conversion in /in/XNX3S on line 10 Array
Output for hhvm-3.10.0 - 3.13.2
ArrayIterator Object ( [storage:ArrayIterator:private] => Array ( [0] => dingo [1] => wombat [2] => wallaby ) [flags:ArrayIterator:private] => 0 ) Array ( [0] => dingo [1] => wombat [2] => wallaby ) Notice: Array to string conversion in /in/XNX3S on line 10 Array
Output for 5.3.0 - 5.3.29
ArrayIterator Object ( [storage:ArrayIterator:private] => Array ( [0] => dingo [1] => wombat [2] => wallaby ) ) Array ( [0] => dingo [1] => wombat [2] => wallaby ) Array
Output for 5.0.0 - 5.2.17
ArrayIterator Object ( [0] => dingo [1] => wombat [2] => wallaby ) Array ( [0] => dingo [1] => wombat [2] => wallaby ) Array
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: arrayiterator in /in/XNX3S on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: arrayiterator in /in/XNX3S on line 3