3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr = array(1,2,3,4,5); $it = new CachingIterator(new ArrayIterator($arr)); var_dump($it->current()); echo PHP_EOL; $it->next(); var_dump($it->current()); echo PHP_EOL;
Output for 5.0.2 - 7.1.0
NULL int(1)
Output for 5.0.0 - 5.0.1
NULL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/406X5 on line 5 PHP_EOLint(1) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/406X5 on line 7 PHP_EOL
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: cachingiterator in /in/406X5 on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: cachingiterator in /in/406X5 on line 4