3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function MaxArray($arr) { $it = new RecursiveIteratorIterator(new RecursiveArrayIterator($arr)); $it->next(); $max = $it->current(); foreach($it as $v) if ( $v > $max ) $max = $v; return $max; } echo MaxArray(array('121','414'),'12','515',array('122',array('646','4241')));
Output for 5.1.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
414
Output for 5.0.0 - 5.0.5
Fatal error: Class 'RecursiveArrayIterator' not found in /in/2LvME on line 5
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: recursiveiteratoriterator in /in/2LvME on line 5
Process exited with code 255.
Output for 4.3.1
Fatal error: Cannot instantiate non-existent class: recursiveiteratoriterator in /in/2LvME on line 5
Output for 4.3.0
Fatal error: Cannot instantiate non-existent class: recursiveiteratoriterator in /in/RqRXA on line 5