3v4l.org

run code in 300+ PHP versions simultaneously
<?php const PERMANENT = -1; function mergeMaxAges() { $max_ages = func_get_args(); // Filter out all max-age values set to cache permanently. if (in_array(PERMANENT, $max_ages)) { $max_ages = array_filter($max_ages, function ($max_age) { return $max_age !== PERMANENT; }); // If nothing is left, then all max-age values were set to cache // permanently, and then that is the result. if (empty($max_ages)) { return PERMANENT; } } return min($max_ages); } for ($i = 0; $i < 10000; $i++) { mergeMaxAges(0, 60); mergeMaxAges(0, 0); mergeMaxAges(0, PERMANENT); mergeMaxAges(PERMANENT, 60); mergeMaxAges(PERMANENT, PERMANENT); }

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)
8.3.60.0100.02118.31
8.3.50.0130.02722.10
8.3.40.0070.02318.73
8.3.30.0040.02518.92
8.3.20.0060.01120.16
8.3.10.0060.01023.65
8.3.00.0060.00919.14
8.2.180.0120.03118.13
8.2.170.0160.02622.96
8.2.160.0070.02322.07
8.2.150.0030.01224.18
8.2.140.0060.00924.66
8.2.130.0070.01026.16
8.2.120.0030.01319.66
8.2.110.0100.01320.96
8.2.100.0000.02417.78
8.2.90.0030.01720.57
8.2.80.0070.01717.97
8.2.70.0060.01617.80
8.2.60.0000.02118.09
8.2.50.0070.01718.10
8.2.40.0000.02119.28
8.2.30.0030.01819.28
8.2.20.0000.02217.78
8.2.10.0060.01618.03
8.2.00.0060.01617.83
8.1.280.0100.03325.92
8.1.270.0030.01318.88
8.1.260.0040.01226.35
8.1.250.0030.01228.09
8.1.240.0030.01722.52
8.1.230.0030.02020.88
8.1.220.0040.01817.74
8.1.210.0030.01919.04
8.1.200.0070.01617.25
8.1.190.0060.01617.13
8.1.180.0070.01718.10
8.1.170.0060.01618.57
8.1.160.0040.01818.80
8.1.150.0060.01618.88
8.1.140.0000.02217.54
8.1.130.0030.01817.45
8.1.120.0030.01817.37
8.1.110.0030.02017.47
8.1.100.0040.01817.54
8.1.90.0070.01517.45
8.1.80.0060.01517.39
8.1.70.0040.01817.48
8.1.60.0040.01917.62
8.1.50.0030.02017.59
8.1.40.0000.02217.57
8.1.30.0000.02317.71
8.1.20.0030.01917.55
8.1.10.0040.01817.55
8.1.00.0000.02317.46
8.0.300.0000.02119.86
8.0.290.0100.01316.58
8.0.280.0000.02118.34
8.0.270.0040.01817.16
8.0.260.0000.02016.84
8.0.250.0060.01516.86
8.0.240.0000.02016.93
8.0.230.0000.02116.93
8.0.220.0000.02116.92
8.0.210.0040.01816.91
8.0.200.0040.01816.88
8.0.190.0030.01916.97
8.0.180.0060.01516.98
8.0.170.0000.02216.84
8.0.160.0030.01816.87
8.0.150.0000.02116.89
8.0.140.0000.02216.80
8.0.130.0000.01913.30
8.0.120.0000.02216.92
8.0.110.0040.01816.88
8.0.100.0040.01916.71
8.0.90.0040.01816.95
8.0.80.0160.04016.86
8.0.70.0000.02216.73
8.0.60.0070.01516.82
8.0.50.0060.01616.71
8.0.30.0130.02717.13
8.0.20.0150.02617.40
8.0.10.0030.01917.07
8.0.00.0070.03016.83
7.4.330.0060.01615.03
7.4.320.0000.02016.54
7.4.300.0030.01716.61
7.4.290.0060.01516.53
7.4.280.0030.01916.37
7.4.270.0030.01916.54
7.4.260.0090.02216.50
7.4.250.0060.01516.49
7.4.240.0040.01616.58
7.4.230.0000.02116.64
7.4.220.0180.01816.53
7.4.210.0050.02916.56
7.4.200.0060.01616.57
7.4.160.0030.03116.64
7.4.150.0090.02817.40
7.4.140.0080.02917.86
7.4.130.0120.02716.57
7.4.120.0070.03016.60
7.4.110.0130.03716.54
7.4.100.0100.02816.34
7.4.90.0060.03016.45
7.4.80.0070.03019.39
7.4.70.0140.02316.53
7.4.60.0060.02916.65
7.4.50.0030.02616.70
7.4.40.0100.02616.61
7.4.30.0090.02516.57
7.4.10.0100.04214.80
7.4.00.0050.04014.93
7.3.330.0000.02113.11
7.3.320.0000.02113.25
7.3.310.0040.01816.22
7.3.300.0000.02016.21
7.3.290.0030.01716.45
7.3.280.0100.03016.37
7.3.270.0150.04317.40
7.3.260.0100.03716.36
7.3.250.0110.02616.61
7.3.240.0100.02716.41
7.3.230.0130.06616.39
7.3.210.0060.02916.39
7.3.200.0100.03619.39
7.3.190.0100.02616.40
7.3.180.0100.02516.43
7.3.170.0100.03616.47
7.3.160.0070.02716.39
7.3.130.0000.04014.86
7.3.120.0060.03814.97
7.3.110.0030.04815.08
7.3.100.0130.03714.82
7.3.90.0030.04015.03
7.3.80.0070.02214.82
7.3.70.0100.02914.96
7.3.60.0100.04214.64
7.3.50.0030.02914.96
7.3.40.0070.03014.85
7.3.30.0000.03814.66
7.3.20.0070.04216.41
7.3.10.0000.03416.46
7.3.00.0070.02716.72
7.2.330.0180.02516.79
7.2.320.0100.02716.71
7.2.310.0180.06216.68
7.2.300.0140.02416.74
7.2.290.0070.03216.86
7.2.260.0030.05414.59
7.2.250.0100.04714.92
7.2.240.0090.02815.19
7.2.230.0100.04314.98
7.2.220.0070.03115.18
7.2.210.0000.03715.30
7.2.200.0100.02614.98
7.2.190.0030.05014.96
7.2.180.0030.03015.10
7.2.170.0070.03115.12
7.2.160.0030.03815.04
7.2.150.0030.04716.92
7.2.140.0060.03216.89
7.2.130.0120.01817.02
7.2.120.0100.04216.68
7.2.110.0250.02216.55
7.2.100.0060.04117.16
7.2.90.0000.03817.07
7.2.80.0070.02717.02
7.2.70.0030.03316.99
7.2.60.0020.03117.02
7.2.50.0030.03017.08
7.2.40.0060.03817.00
7.2.30.0040.03216.70
7.2.20.0090.02217.12
7.2.10.0070.03416.91
7.2.00.0020.03718.23
7.1.330.0030.04615.90
7.1.320.0060.05315.80
7.1.310.0000.04915.96
7.1.300.0130.04515.77
7.1.290.0030.04115.95
7.1.280.0000.04515.61
7.1.270.0000.04815.77
7.1.260.0070.03715.88
7.1.250.0000.04516.00
7.1.240.0030.05915.87
7.1.230.0030.04515.96
7.1.220.0000.05515.54
7.1.210.0030.04115.80
7.1.200.0030.03215.69
7.1.190.0030.04215.71
7.1.180.0100.04115.83
7.1.170.0030.05115.76
7.1.160.0040.04215.91
7.1.150.0100.04015.84
7.1.140.0070.06215.95
7.1.130.0030.06516.00
7.1.120.0030.04215.68
7.1.110.0030.04315.82
7.1.100.0030.04217.01
7.1.90.0100.04015.78
7.1.80.0030.04615.82
7.1.70.0030.03716.52
7.1.60.0030.05017.45
7.1.50.0070.03916.46
7.1.40.0030.05715.55
7.1.30.0030.03815.79
7.1.20.0030.04615.78
7.1.10.0100.03715.82
7.1.00.0050.07319.09
7.0.330.0100.04415.23
7.0.320.0000.06115.11
7.0.310.0030.04215.38
7.0.300.0000.04715.26
7.0.290.0030.05015.51
7.0.280.0030.04815.44
7.0.270.0070.05615.61
7.0.260.0030.04215.21
7.0.250.0030.04415.18
7.0.240.0100.03515.49
7.0.230.0000.05015.55
7.0.220.0070.04415.54
7.0.210.0000.04715.32
7.0.200.0050.04616.16
7.0.190.0000.04915.28
7.0.180.0030.04515.45
7.0.170.0030.05315.57
7.0.160.0000.05115.68
7.0.150.0070.04315.46
7.0.140.0050.07218.76
7.0.130.0030.04015.40
7.0.120.0030.04015.39
7.0.110.0030.04015.03
7.0.100.0030.04415.55
7.0.90.0030.04115.18
7.0.80.0060.03815.20
7.0.70.0030.03915.29
7.0.60.0070.07917.66
7.0.50.0030.07316.64
7.0.40.0050.07816.87
7.0.30.0130.06516.92
7.0.20.0130.08416.89
7.0.10.0020.05816.94
7.0.00.0050.07916.77
5.6.400.0060.07114.33
5.6.390.0030.09114.17
5.6.380.0060.07214.55
5.6.370.0030.07314.49
5.6.360.0030.07314.75
5.6.350.0000.07714.45
5.6.340.0100.06814.37
5.6.330.0070.07314.15
5.6.320.0100.06914.36
5.6.310.0060.07014.68
5.6.300.0030.07814.45
5.6.290.0030.07514.50
5.6.280.0030.10517.49
5.6.270.0030.07614.11
5.6.260.0030.07814.25
5.6.250.0070.08514.32
5.6.240.0000.07914.22
5.6.230.0000.07714.20
5.6.220.0100.08114.52
5.6.210.0120.11617.53
5.6.200.0070.09316.38
5.6.190.0030.08017.42
5.6.180.0030.08317.30
5.6.170.0180.11217.18
5.6.160.0030.10117.68
5.6.150.0070.09716.37
5.6.140.0070.11116.26
5.6.130.0100.08916.21
5.6.120.0030.07717.85
5.6.110.0130.10217.71
5.6.100.0050.08417.55
5.6.90.0070.08417.66
5.6.80.0030.09017.44
5.6.70.0000.07614.36
5.6.60.0070.08014.30
5.6.50.0000.07814.34
5.6.40.0100.07114.46
5.6.30.0000.07814.02
5.6.20.0030.07014.20
5.6.10.0070.07114.14
5.6.00.0030.11414.06
5.5.380.0070.07714.06
5.5.370.0030.07414.13
5.5.360.0030.09414.47
5.5.350.2180.07517.33
5.5.340.0020.09116.09
5.5.330.0050.09017.32
5.5.320.0170.07617.25
5.5.310.0120.09217.23
5.5.300.0020.10316.14
5.5.290.0050.09516.21
5.5.280.0080.09117.54
5.5.270.0070.07717.66
5.5.260.0080.08417.60
5.5.250.0050.11517.43
5.5.240.0080.10717.28
5.5.230.0000.07714.22
5.5.220.0030.10614.19
5.5.210.0000.10313.99
5.5.200.0000.08114.23
5.5.190.0100.07314.15
5.5.180.0030.10714.22
5.5.170.0060.08814.19
5.5.160.0100.10414.38
5.5.150.0030.10614.34
5.5.140.0030.08313.91
5.5.130.0000.08813.96
5.5.120.0030.07113.99
5.5.110.0030.07514.24
5.5.100.0000.08514.24
5.5.90.0030.07714.21
5.5.80.0000.08114.19
5.5.70.0030.11214.48
5.5.60.0000.07814.06
5.5.50.0000.07913.80
5.5.40.0030.07614.43
5.5.30.0000.09914.29
5.5.20.0000.09214.40
5.5.10.0000.08713.79
5.5.00.0030.09014.08
5.4.450.0170.12715.31
5.4.440.0500.14115.21
5.4.430.0450.09815.31
5.4.420.0050.11215.33
5.4.410.0030.10915.27
5.4.400.0080.10115.01
5.4.390.0100.09815.10
5.4.380.0100.10614.93
5.4.370.0120.11214.66
5.4.360.0070.10314.83
5.4.350.0130.10214.81
5.4.340.0100.11614.71
5.4.330.0100.06411.13
5.4.320.0150.14414.74
5.4.310.0070.11914.90
5.4.300.0130.09414.87
5.4.290.0050.10614.63
5.4.280.0120.10415.00
5.4.270.0080.11914.72
5.4.260.0120.12415.02
5.4.250.0050.13214.72
5.4.240.0120.12814.77
5.4.230.0130.10114.89
5.4.220.0100.10314.74
5.4.210.0050.11114.85
5.4.200.0070.09813.81
5.4.190.0130.10514.98
5.4.180.0150.11414.74
5.4.170.0120.11114.69
5.4.160.0080.10914.88
5.4.150.0100.10314.75
5.4.140.0130.09713.53
5.4.130.0130.10413.60
5.4.120.0080.10813.73
5.4.110.0100.10113.62
5.4.100.0050.09813.50
5.4.90.0130.10113.56
5.4.80.0100.10613.58
5.4.70.0080.10613.57
5.4.60.0100.09513.71
5.4.50.0080.10013.52
5.4.40.0080.13113.47
5.4.30.0070.11213.60
5.4.20.0030.12013.66
5.4.10.0070.09613.59
5.4.00.0150.09213.22
5.3.290.0130.14714.70
5.3.280.0200.13714.78
5.3.270.0230.18014.64
5.3.260.0000.15714.63
5.3.250.0270.13314.72
5.3.240.0070.14014.61
5.3.230.0070.14714.64
5.3.220.0270.14314.63
5.3.210.0170.20014.71
5.3.200.0130.16014.67
5.3.190.0130.21314.59
5.3.180.0200.16714.55
5.3.170.0130.16714.70
5.3.160.0170.14014.77
5.3.150.0170.14314.77
5.3.140.0170.18314.78
5.3.130.0170.14314.69
5.3.120.0200.24014.60
5.3.110.0130.17314.59
5.3.100.0100.23014.17
5.3.90.0130.18014.07
5.3.80.0270.19014.10
5.3.70.0170.16014.09
5.3.60.0170.13014.03
5.3.50.0100.14313.99
5.3.40.0070.14714.01
5.3.30.0130.22014.12
5.3.20.0100.14013.83
5.3.10.0130.13013.89
5.3.00.0170.13313.70
5.2.170.0130.04311.14
5.2.160.0170.03711.05
5.2.150.0030.05011.18
5.2.140.0100.04311.10
5.2.130.0130.04011.13
5.2.120.0130.05311.09
5.2.110.0300.04011.08
5.2.100.0030.05711.05
5.2.90.0070.04311.25
5.2.80.0230.03711.08
5.2.70.0200.04011.15
5.2.60.0170.03711.09
5.2.50.0200.04710.98
5.2.40.0130.05010.96
5.2.30.0270.04010.90
5.2.20.0100.04310.97
5.2.10.0100.04010.91
5.2.00.0070.04710.73
5.1.60.0170.04010.11
5.1.50.0130.04010.02
5.1.40.0130.03710.11
5.1.30.0100.04010.34
5.1.20.0100.04010.46
5.1.10.0170.04010.04
5.1.00.0070.04310.13
5.0.50.0130.0238.52
5.0.40.0070.0278.43
5.0.30.0030.0478.36
5.0.20.0030.0308.23
5.0.10.0130.0238.35
5.0.00.0030.0478.18
4.4.90.0230.0135.83
4.4.80.0070.0305.86
4.4.70.0100.0275.86
4.4.60.0070.0305.94
4.4.50.0070.0305.89
4.4.40.0100.0405.94
4.4.30.0170.0205.94
4.4.20.0070.0275.95
4.4.10.0070.0305.96
4.4.00.0100.0335.98
4.3.110.0200.0205.83
4.3.100.0000.0275.82
4.3.90.0030.0235.78
4.3.80.0030.0375.77
4.3.70.0130.0135.78
4.3.60.0070.0275.77
4.3.50.0070.0275.81
4.3.40.0130.0375.89
4.3.30.0070.0204.96
4.3.20.0000.0234.96
4.3.10.0000.0234.96
4.3.00.0000.0277.12

preferences:
61.15 ms | 401 KiB | 5 Q