<?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.3.0 - 5.3.24, 5.4.0 - 5.4.14
- Parse error: syntax error, unexpected '{' in /in/q0pUr on line 6
Process exited with code 255.
preferences:
177.79 ms | 936 KiB | 48 Q