<?php
const PERMANENT = -1;
function has_permanent(array $max_ages) {
$has_permanent = FALSE;
foreach ($max_ages as $max_age) {
if ($max_age === PERMANENT) {
$has_permanent = TRUE;
break;
}
}
return $has_permanent;
}
$max_ages_1 = [0, 0];
$max_ages_2 = [0, 60];
$max_ages_3 = [0, PERMANENT];
$max_ages_4 = [60, PERMANENT];
$max_ages_5 = [PERMANENT, PERMANENT];
for ($i = 0; $i < 10000; $i++) {
has_permanent($max_ages_1));
has_permanent($max_ages_2));
has_permanent($max_ages_3));
has_permanent($max_ages_4));
has_permanent($max_ages_5));
}
- Output for 5.4.0 - 5.4.38
- Parse error: syntax error, unexpected ')' in /in/VVNBe on line 22
Process exited with code 255. - Output for 5.3.0 - 5.3.29
- Parse error: syntax error, unexpected '[' in /in/VVNBe on line 15
Process exited with code 255. - Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
- Parse error: syntax error, unexpected T_CONST in /in/VVNBe on line 2
Process exited with code 255. - Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
- Parse error: parse error, unexpected T_CONST in /in/VVNBe on line 2
Process exited with code 255. - Output for 4.3.2 - 4.3.4
- Parse error: parse error in /in/VVNBe on line 2
Process exited with code 255.
preferences:
176.14 ms | 1403 KiB | 129 Q