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)); }

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
5.4.380.0230.05318.74
5.4.370.0230.04718.68
5.4.360.0100.06318.62
5.4.350.0230.05318.63
5.4.340.0170.05318.77
5.4.320.0200.05018.56
5.4.310.0170.05318.82
5.4.300.0130.05718.57
5.4.290.0200.05718.59
5.4.280.0200.05718.61
5.4.270.0200.06018.68
5.4.260.0200.06018.77
5.4.250.0170.05718.77
5.4.240.0130.05718.67
5.4.230.0100.05718.82
5.4.220.0030.06718.82
5.4.210.0230.04718.46
5.4.200.0100.05716.71
5.4.190.0230.04318.50
5.4.180.0200.05018.67
5.4.170.0200.05018.48
5.4.160.0130.05318.61
5.4.150.0170.06018.75
5.4.140.0100.05716.22
5.4.130.0100.05316.29
5.4.120.0100.05316.20
5.4.110.0270.05016.32
5.4.100.0100.05716.19
5.4.90.0200.04716.41
5.4.80.0130.05316.21
5.4.70.0230.04316.43
5.4.60.0230.04316.30
5.4.50.0200.05016.40
5.4.40.0200.05016.41
5.4.30.0130.05316.30
5.4.20.0170.06016.27
5.4.10.0130.05716.26
5.4.00.0130.05015.65
5.3.290.0270.04714.69
5.3.280.0130.05314.73
5.3.270.0130.07314.77
5.3.260.0200.07314.63
5.3.250.0230.04714.81
5.3.240.0170.05714.70
5.3.230.0270.05014.72
5.3.220.0230.04714.55
5.3.210.0070.06314.61
5.3.200.0030.06314.60
5.3.190.0170.05014.58
5.3.180.0230.04314.74
5.3.170.0330.04014.73
5.3.160.0270.04314.73
5.3.150.0130.05314.62
5.3.140.0170.05014.60
5.3.130.0200.05014.77
5.3.120.0100.06014.57
5.3.110.0130.05714.68
5.3.100.0170.05314.09
5.3.90.0170.04714.24
5.3.80.0130.05313.99
5.3.70.0100.05314.06
5.3.60.0070.05714.13
5.3.50.0100.05313.98
5.3.40.0070.05713.96
5.3.30.0070.05713.89
5.3.20.0230.06313.71
5.3.10.0170.06313.69
5.3.00.0200.04713.67
5.2.170.0200.03711.06
5.2.160.0230.03011.29
5.2.150.0070.04711.09
5.2.140.0070.04711.11
5.2.130.0170.03711.23
5.2.120.0130.04011.06
5.2.110.0130.04011.02
5.2.100.0070.04311.03
5.2.90.0200.03011.03
5.2.80.0130.04011.13
5.2.70.0100.04711.06
5.2.60.0170.03711.20
5.2.50.0170.04011.07
5.2.40.0130.04310.94
5.2.30.0230.04710.97
5.2.20.0130.04011.02
5.2.10.0170.03311.01
5.2.00.0130.04010.85
5.1.60.0170.03710.13
5.1.50.0100.0339.95
5.1.40.0100.0379.95
5.1.30.0170.03010.45
5.1.20.0200.03310.50
5.1.10.0070.04010.20
5.1.00.0070.04010.18
5.0.50.0070.0278.61
5.0.40.0100.0238.53
5.0.30.0100.0408.32
5.0.20.0130.0208.37
5.0.10.0070.0278.29
5.0.00.0070.0438.24
4.4.90.0100.0175.90
4.4.80.0070.0205.90
4.4.70.0030.0275.88
4.4.60.0070.0205.91
4.4.50.0030.0235.89
4.4.40.0070.0335.93
4.4.30.0070.0205.85
4.4.20.0030.0235.92
4.4.10.0100.0175.97
4.4.00.0030.0375.93
4.3.110.0070.0235.80
4.3.100.0030.0235.76
4.3.90.0100.0205.79
4.3.80.0070.0305.78
4.3.70.0100.0275.83
4.3.60.0100.0235.79
4.3.50.0030.0305.89
4.3.40.0030.0335.86
4.3.30.0100.0174.56
4.3.20.0030.0234.56
4.3.10.0070.0204.50
4.3.00.0000.0237.59

preferences:
143.25 ms | 1394 KiB | 7 Q