3v4l.org

run code in 300+ PHP versions simultaneously
<?php const PERMANENT = -1; function has_permanent(array $max_ages) { return in_array(PERMANENT, $max_ages); } $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/sfiMN on line 15
Process exited with code 255.
Output for 5.3.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/sfiMN on line 8
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/sfiMN 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/sfiMN on line 2
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/sfiMN on line 2
Process exited with code 255.

preferences:
177.09 ms | 1403 KiB | 129 Q