3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo max(1, 3, 5, 6, 7); // 7 echo max(array(2, 4, 5)); // 5 // When 'hello' is cast as integer it will be 0. Both the parameters are equally // long, so the order they are given in determines the result echo max(0, 'hello'); // 0 echo max('hello', 0); // hello echo max('42', 3); // '42' // Here 0 > -1, so 'hello' is the return value. echo max(-1, 'hello'); // hello // With multiple arrays of different lengths, max returns the longest $val = max(array(2, 2, 2), array(1, 1, 1, 1)); // array(1, 1, 1, 1) // With multiple arrays of the same length, max compares from left to right // using lexicographic order, so in our example: 2 == 2, but 4 < 5 $val = max(array(2, 4, 8), array(2, 5, 7)); // array(2, 5, 7) // If both an array and non-array are given, the array // is always returned as it's seen as the largest $val = max('string', array(2, 5, 7), 42); // array(2, 5, 7) ?>

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.0180.00018.02
8.3.50.0100.00521.89
8.3.40.0040.01118.71
8.3.30.0090.00618.82
8.3.20.0040.00420.20
8.3.10.0030.00621.83
8.3.00.0090.00022.34
8.2.180.0080.01116.50
8.2.170.0090.00622.96
8.2.160.0090.00620.88
8.2.150.0050.00324.18
8.2.140.0030.00524.66
8.2.130.0040.00426.16
8.2.120.0050.00319.36
8.2.110.0040.00422.26
8.2.100.0120.00017.53
8.2.90.0040.00419.09
8.2.80.0000.00817.97
8.2.70.0040.00417.63
8.2.60.0000.00817.92
8.2.50.0040.00418.07
8.2.40.0040.00418.22
8.2.30.0040.00418.06
8.2.20.0040.00417.56
8.2.10.0040.00419.46
8.2.00.0000.00917.66
8.1.280.0070.00725.92
8.1.270.0040.00423.96
8.1.260.0080.00026.35
8.1.250.0110.00828.09
8.1.240.0080.00023.82
8.1.230.0090.00319.15
8.1.220.0050.00317.74
8.1.210.0050.00318.77
8.1.200.0060.00317.23
8.1.190.0000.00817.40
8.1.180.0000.00818.10
8.1.170.0030.00618.46
8.1.160.0050.00222.00
8.1.150.0050.00318.56
8.1.140.0040.00417.25
8.1.130.0030.00317.83
8.1.120.0040.00417.36
8.1.110.0030.00517.44
8.1.100.0030.00517.34
8.1.90.0080.00017.34
8.1.80.0080.00017.34
8.1.70.0030.00317.26
8.1.60.0030.00617.47
8.1.50.0040.00417.49
8.1.40.0040.00417.39
8.1.30.0000.00817.49
8.1.20.0040.00417.66
8.1.10.0000.00717.51
8.1.00.0030.00617.37
8.0.300.0000.00718.77
8.0.290.0070.00017.05
8.0.280.0000.00718.46
8.0.270.0030.00317.12
8.0.260.0000.00716.77
8.0.250.0030.00316.83
8.0.240.0030.00316.93
8.0.230.0000.00716.89
8.0.220.0040.00416.85
8.0.210.0000.00716.82
8.0.200.0030.00316.80
8.0.190.0040.00416.78
8.0.180.0000.00716.88
8.0.170.0030.00516.83
8.0.160.0050.00216.70
8.0.150.0030.00616.72
8.0.140.0000.00716.64
8.0.130.0060.00013.24
8.0.120.0000.00816.75
8.0.110.0030.00316.82
8.0.100.0000.00716.84
8.0.90.0080.00016.66
8.0.80.0060.00916.75
8.0.70.0030.00516.92
8.0.60.0000.00716.63
8.0.50.0070.00016.70
8.0.30.0170.00216.83
8.0.20.0090.01017.40
8.0.10.0020.00516.77
8.0.00.0070.01316.90
7.4.330.0000.00515.01
7.4.320.0000.00616.43
7.4.300.0000.00716.52
7.4.290.0000.00716.44
7.4.280.0060.00016.43
7.4.270.0040.00416.54
7.4.260.0000.00916.53
7.4.250.0000.00716.51
7.4.240.0030.00516.48
7.4.230.0000.00716.63
7.4.220.0030.01616.49
7.4.210.0080.00616.53
7.4.200.0040.00416.38
7.4.190.0030.00316.41
7.4.160.0160.00616.56
7.4.150.0140.00417.40
7.4.140.0100.01117.86
7.4.130.0090.01316.41
7.4.120.0090.00916.47
7.4.110.0100.00716.38
7.4.100.0100.01016.53
7.4.90.0150.01016.50
7.4.80.0090.00919.39
7.4.70.0140.00316.45
7.4.60.0060.01016.49
7.4.50.0000.00516.29
7.4.40.0080.00522.77
7.4.30.0080.00816.43
7.4.00.0030.01414.89
7.3.330.0050.00012.89
7.3.320.0000.00512.87
7.3.310.0000.00716.03
7.3.300.0070.00016.17
7.3.290.0140.00716.18
7.3.280.0090.01116.13
7.3.270.0100.00717.40
7.3.260.0190.00616.28
7.3.250.0070.01316.42
7.3.240.0070.01016.39
7.3.230.0060.01216.39
7.3.210.0170.00016.29
7.3.200.0120.00919.39
7.3.190.0120.00616.21
7.3.180.0080.00816.17
7.3.170.0100.00616.45
7.3.160.0030.01316.02
7.3.120.0030.01214.82
7.3.110.0070.01014.38
7.3.100.0030.01314.76
7.3.90.0090.00614.75
7.3.80.0030.00614.62
7.3.70.0090.00614.88
7.3.60.0050.00514.54
7.3.50.0000.00814.80
7.3.40.0070.01014.84
7.3.30.0030.01014.66
7.3.20.0070.00416.38
7.3.10.0040.00716.57
7.3.00.0060.00616.50
7.2.330.0070.01016.61
7.2.320.0030.02116.59
7.2.310.0080.00816.66
7.2.300.0100.00716.58
7.2.290.0070.01016.69
7.2.250.0120.00614.93
7.2.240.0070.01115.17
7.2.230.0080.00314.94
7.2.220.0070.00314.90
7.2.210.0120.00014.92
7.2.200.0070.00715.16
7.2.190.0030.00614.80
7.2.180.0040.00714.68
7.2.170.0030.00914.66
7.2.130.0030.01116.84
7.2.120.0020.01316.70
7.2.110.0050.00916.80
7.2.100.0030.00916.96
7.2.90.0040.00916.58
7.2.80.0050.00716.78
7.2.70.0040.00516.58
7.2.60.0050.00916.81
7.2.50.0050.01016.68
7.2.40.0030.00916.80
7.2.30.0030.01016.96
7.2.20.0020.01216.79
7.2.10.0070.00516.72
7.2.00.0070.00717.64
7.1.330.0100.00315.77
7.1.320.0030.00715.75
7.1.310.0060.00615.67
7.1.300.0060.00915.64
7.1.290.0000.01515.56
7.1.280.0030.01315.69
7.1.270.0100.00615.56
7.1.260.0070.00715.45
7.1.250.0000.01215.76
7.1.200.0000.01215.50
7.1.100.0160.00418.04
7.1.70.0030.00916.84
7.1.60.0090.01519.82
7.1.50.0070.01316.75
7.1.00.0030.07722.30
7.0.200.0030.00916.62
7.0.140.0030.07321.99
7.0.70.0070.08021.73
7.0.60.0030.06021.75
7.0.50.0030.04022.04
7.0.40.0070.04320.16
7.0.30.0130.07720.08
7.0.20.0030.06720.08
7.0.10.0030.08320.18
7.0.00.0030.05319.99
5.6.280.0030.07321.15
5.6.220.0070.08020.49
5.6.210.0030.05020.62
5.6.200.0070.08321.09
5.6.190.0000.05720.91
5.6.180.0100.08321.08
5.6.170.0130.08020.96
5.6.160.0070.06321.02
5.6.150.0130.07320.99
5.6.140.0070.06320.93
5.6.130.0030.09021.02
5.6.120.0070.08020.95
5.6.110.0130.06721.15
5.6.100.0100.08021.00
5.6.90.0100.05321.05
5.6.80.0070.05320.32
5.6.70.0200.07320.39
5.6.60.0030.08320.41
5.6.50.0000.06720.34
5.6.40.0070.07720.46
5.6.30.0070.07720.43
5.6.20.0030.07020.45
5.6.10.0070.08020.39
5.6.00.0070.06320.29
5.5.360.0100.07720.39
5.5.350.0130.07020.43
5.5.340.0030.09020.91
5.5.330.0100.06320.90
5.5.320.0000.08720.89
5.5.310.0030.06320.92
5.5.300.0030.08320.83
5.5.290.0000.08320.75
5.5.280.0130.07320.88
5.5.270.0070.08320.71
5.5.260.0070.08020.88
5.5.250.0000.09020.45
5.5.240.0070.07720.21
5.5.230.0030.08720.13
5.5.220.0000.07020.29
5.5.210.0030.07019.99
5.5.200.0000.08320.18
5.5.190.0100.07720.22
5.5.180.0070.08020.25
5.5.160.0000.04720.08
5.5.150.0100.07320.27
5.5.140.0000.09020.23
5.5.130.0070.08020.25
5.5.120.0070.07719.97
5.5.110.0000.08020.27
5.5.100.0070.07720.13
5.5.90.0070.07319.94
5.5.80.0000.08020.12
5.5.70.0000.05020.10
5.5.60.0030.07720.09
5.5.50.0000.08320.05
5.5.40.0030.08019.95
5.5.30.0100.06720.02
5.5.20.0070.07720.05
5.5.10.0200.06319.97
5.5.00.0070.07720.03
5.4.450.0070.07019.29
5.4.440.0000.07019.20
5.4.430.0070.05719.29
5.4.420.0070.07719.44
5.4.410.0000.08019.32
5.4.400.0130.07018.96
5.4.390.0070.07319.09
5.4.380.0030.05719.04
5.4.370.0070.06719.11
5.4.360.0030.07019.13
5.4.350.0030.06018.81
5.4.340.0070.07718.90
5.4.320.0030.07718.79
5.4.310.0130.07019.03
5.4.300.0030.08018.77
5.4.290.0030.07718.96
5.4.280.0070.07019.02
5.4.270.0000.08018.78
5.4.260.0030.07718.78
5.4.250.0070.07019.13
5.4.240.0130.07018.94
5.4.230.0030.07719.06
5.4.220.0100.07318.80
5.4.210.0070.08018.80
5.4.200.0070.07318.97
5.4.190.0070.07319.04
5.4.180.0100.07718.89
5.4.170.0030.07718.95
5.4.160.0000.05718.92
5.4.150.0100.07019.04
5.4.140.0030.07716.27
5.4.130.0030.05316.36
5.4.120.0030.07316.38
5.4.110.0030.07716.34
5.4.100.0070.06716.30
5.4.90.0030.05316.43
5.4.80.0030.06716.43
5.4.70.0030.07316.31
5.4.60.0000.08016.32
5.4.50.0030.05716.18
5.4.40.0070.05316.29
5.4.30.0070.07316.41
5.4.20.0000.07716.30
5.4.10.0000.07716.19
5.4.00.0000.07715.51
5.3.290.0000.05314.53
5.3.280.0070.07014.46
5.3.270.0030.08314.55
5.3.260.0070.05014.62
5.3.250.0030.08014.55
5.3.240.0000.05014.61
5.3.230.0030.08014.55
5.3.220.0030.07714.56
5.3.210.0070.07014.55
5.3.200.0030.07014.40
5.3.190.0000.04314.55
5.3.180.0070.03314.52
5.3.170.0030.07714.44
5.3.160.0130.06314.43
5.3.150.0070.07314.40
5.3.140.0030.08014.55
5.3.130.0070.07714.51
5.3.120.0070.07314.52
5.3.110.0000.08014.38
5.3.100.0030.04713.94
5.3.90.0070.07313.96
5.3.80.0030.07314.01
5.3.70.0030.07713.93
5.3.60.0100.06313.86
5.3.50.0000.06313.95
5.3.40.0000.07713.89
5.3.30.0100.06713.77
5.3.20.0030.06013.63
5.3.10.0030.06713.56
5.3.00.0030.05013.63
5.2.170.0000.06013.55
5.2.160.0030.04713.55
5.2.150.0070.06013.55
5.2.140.0000.07013.55
5.2.130.0000.06313.55
5.2.120.0000.06713.55
5.2.110.0030.05013.55
5.2.100.0000.05313.55
5.2.90.0000.06713.55
5.2.80.0030.06013.55
5.2.70.0000.06713.55
5.2.60.0100.05313.55
5.2.50.0030.05713.55
5.2.40.0030.06013.55
5.2.30.0030.06313.55
5.2.20.0000.06313.55
5.2.10.0070.05713.55
5.2.00.0000.06313.55
5.1.60.0000.05713.55
5.1.50.0030.05313.55
5.1.40.0000.05313.55
5.1.30.0070.04313.55
5.1.20.0030.05313.55
5.1.10.0000.03013.55
5.1.00.0030.02713.55
5.0.50.0000.05013.55
5.0.40.0000.04713.55
5.0.30.0000.06713.55
5.0.20.0000.05013.55
5.0.10.0030.04313.55
5.0.00.0000.06313.55
4.4.90.0100.02713.55
4.4.80.0030.03013.55
4.4.70.0100.03013.55
4.4.60.0000.04013.55
4.4.50.0030.03313.55
4.4.40.0000.04713.55
4.4.30.0030.02013.55
4.4.20.0000.02313.55
4.4.10.0000.03313.55
4.4.00.0030.05313.55
4.3.110.0000.03313.55
4.3.100.0030.03013.55
4.3.90.0000.02713.55
4.3.80.0000.05013.55
4.3.70.0070.03013.55
4.3.60.0000.03313.55
4.3.50.0030.03713.55
4.3.40.0030.05013.55
4.3.30.0000.03713.55
4.3.20.0000.03713.55
4.3.10.0030.03013.55
4.3.00.0000.03013.55

preferences:
38.47 ms | 401 KiB | 5 Q