3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr = array(array(141,151,161), 2, 3, array(101, 202, array(303,404))); function MaxArray($arr) { $max = ~PHP_INT_MAX; foreach($arr as $val) { if(is_array($val)) { $max = MaxArray($val); } if($val > $max) { $max = $val; } } return $max; } print MaxArray($arr);
Output for 5.4.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Notice: Array to string conversion in /in/tDZcG on line 15 Array
Output for 4.4.0 - 4.4.9, 5.0.5 - 5.3.29
Array
Output for 4.3.0 - 4.3.11, 5.0.0 - 5.0.4
Notice: Use of undefined constant PHP_INT_MAX - assumed 'PHP_INT_MAX' in /in/tDZcG on line 4 Notice: Use of undefined constant PHP_INT_MAX - assumed 'PHP_INT_MAX' in /in/tDZcG on line 4 Notice: Use of undefined constant PHP_INT_MAX - assumed 'PHP_INT_MAX' in /in/tDZcG on line 4 Notice: Use of undefined constant PHP_INT_MAX - assumed 'PHP_INT_MAX' in /in/tDZcG on line 4 Array