3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr = new ArrayIterator(array(1)); var_dump($arr->current()); iterator_to_array($arr, false); var_dump($arr->current());
based on LeY6l
Output for 5.2.1 - 7.1.0
int(1) NULL
Output for 5.1.0 - 5.2.0
int(1) Warning: iterator_to_array() expects exactly 1 parameter, 2 given in /in/4phoi on line 5 int(1)
Output for 5.0.0 - 5.0.5
int(1) Fatal error: Call to undefined function iterator_to_array() in /in/4phoi on line 5
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: arrayiterator in /in/4phoi 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/4phoi on line 3