3v4l.org

run code in 300+ PHP versions simultaneously
<?php // This code works with PHP 7.4. // Older versions of PHP are counter-revolutionary. namespace stalin; function sort(array $xs): array { if (count($xs) <= 1) { return $xs; } $zs = $xs; $x = array_shift($zs); $y = array_shift($zs); if ($x <= $y) { return [$x, ...sort([$y, ...$zs])]; } return sort([$x, ...$zs]); } echo json_encode(sort([1, 2, 1, 1, 4, 3, 9]));

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.70.0100.01016.25
8.3.60.0040.01118.55
8.3.50.0110.00821.04
8.3.40.0160.00318.70
8.3.30.0100.00318.66
8.3.20.0040.00421.91
8.3.10.0040.00422.09
8.3.00.0040.00423.71
8.2.190.0040.01116.63
8.2.180.0060.00916.75
8.2.170.0070.00722.96
8.2.160.0000.01819.46
8.2.150.0000.00825.66
8.2.140.0050.00324.66
8.2.130.0000.00726.16
8.2.120.0070.00019.95
8.2.110.0000.00922.13
8.2.100.0040.00917.78
8.2.90.0050.00322.33
8.2.80.0040.00419.21
8.2.70.0030.00618.03
8.2.60.0060.00318.34
8.2.50.0050.00318.10
8.2.40.0000.00719.53
8.2.30.0040.00419.32
8.2.20.0040.00418.00
8.2.10.0080.00019.35
8.2.00.0040.00419.13
8.1.280.0100.00725.92
8.1.270.0090.00022.23
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0040.00422.50
8.1.230.0040.00720.84
8.1.220.0030.00517.74
8.1.210.0000.00818.77
8.1.200.0000.00817.36
8.1.190.0080.00017.23
8.1.180.0040.00418.10
8.1.170.0000.00818.63
8.1.160.0040.00420.54
8.1.150.0040.00418.94
8.1.140.0000.00720.78
8.1.130.0000.00720.11
8.1.120.0000.00817.39
8.1.110.0030.00617.46
8.1.100.0040.00417.42
8.1.90.0030.00617.42
8.1.80.0000.00717.47
8.1.70.0000.00817.44
8.1.60.0030.00617.64
8.1.50.0040.00417.42
8.1.40.0040.00417.40
8.1.30.0060.00617.64
8.1.20.0060.00317.56
8.1.10.0000.00717.65
8.1.00.0030.00717.41
8.0.300.0070.00020.03
8.0.290.0050.00216.63
8.0.280.0000.00718.44
8.0.270.0070.00017.19
8.0.260.0030.00320.13
8.0.250.0040.00417.00
8.0.240.0030.00316.93
8.0.230.0070.00017.00
8.0.220.0000.00716.89
8.0.210.0040.00416.74
8.0.200.0080.00016.98
8.0.190.0000.00717.03
8.0.180.0000.00716.91
8.0.170.0080.00016.92
8.0.160.0030.00516.86
8.0.150.0080.00016.84
8.0.140.0070.00016.82
8.0.130.0050.00013.32
8.0.120.0000.00816.77
8.0.110.0070.00016.85
8.0.100.0000.00716.95
8.0.90.0030.00616.82
8.0.80.0090.00616.94
8.0.70.0000.00716.89
8.0.60.0040.00416.94
8.0.50.0040.00416.87
8.0.30.0110.00817.06
8.0.20.0030.01616.88
8.0.10.0040.00417.00
8.0.00.0110.01316.68
7.4.330.0000.00615.55
7.4.320.0000.00616.50
7.4.300.0030.00316.66
7.4.290.0060.00316.53
7.4.280.0000.00816.61
7.4.270.0040.00416.51
7.4.260.0030.00313.28
7.4.250.0000.00816.58
7.4.240.0010.00616.61
7.4.230.0030.00316.63
7.4.220.0030.00316.59
7.4.210.0070.01116.70
7.4.200.0070.00016.36
7.4.140.0110.00817.86
7.4.130.0080.00916.49
7.4.120.0120.01216.71
7.4.110.0100.01016.37
7.4.100.0060.01516.48
7.4.90.0130.00816.43
7.4.80.0100.01019.39
7.4.70.0080.00816.57
7.4.60.0130.00316.49
7.4.50.0040.01416.36
7.4.40.0110.00516.57
7.4.10.0140.00415.13
7.4.00.0000.01414.91
7.3.330.0030.00316.26
7.3.320.0020.00213.01
7.3.310.0070.00016.01
7.3.300.0040.00416.05
7.3.290.0070.00016.05
7.3.280.0070.00716.27
7.3.260.0110.00816.38
7.3.240.0110.00816.29
7.3.230.0090.01216.35
7.3.210.0100.00716.11
7.3.200.0110.01116.25
7.3.190.0130.00316.13
7.3.180.0030.01316.21
7.3.170.0100.00716.28
7.3.160.0070.01116.21
7.3.130.0100.01014.59
7.3.120.0100.00714.61
7.3.110.0130.00614.76
7.3.100.0070.00414.66
7.3.90.0150.00314.48
7.3.80.0000.01014.53
7.3.70.0030.00814.60
7.3.60.0070.00914.58
7.3.50.0040.01114.74
7.3.40.0050.00914.66
7.3.30.0030.00714.66
7.3.20.0030.00816.57
7.3.10.0080.00516.58
7.3.00.0060.01116.42
7.2.330.0120.00616.54
7.2.320.0160.00016.23
7.2.310.0170.00016.17
7.2.300.0040.01216.14
7.2.290.0100.01316.43
7.2.260.0070.01314.84
7.2.250.0070.01114.71
7.2.240.0140.00014.78
7.2.230.0070.00715.02
7.2.220.0090.00614.70
7.2.210.0100.00614.38
7.2.200.0110.00614.63
7.2.190.0060.00914.67
7.2.180.0090.00814.63
7.2.170.0040.00914.83
7.2.160.0030.01114.83
7.2.150.0070.00816.73
7.2.140.0070.00616.64
7.2.130.0070.01216.56
7.2.120.0060.01216.64
7.2.110.0070.00716.75
7.2.100.0020.01116.60
7.2.90.0080.00616.66
7.2.80.0110.00516.65
7.2.70.0080.00716.76
7.2.60.0070.00816.67
7.2.50.0100.00316.71
7.2.40.0060.00816.78
7.2.30.0030.01016.74
7.2.20.0050.01016.55
7.2.10.0110.00716.55
7.2.00.0060.00916.68
7.1.330.0040.00715.45
7.1.320.0070.00415.59
7.1.310.0090.00615.58
7.1.300.0060.00815.38
7.1.290.0030.01315.54
7.1.280.0050.00715.45
7.1.270.0050.01015.37
7.1.260.0050.00615.39
7.1.250.0090.00315.66
7.1.240.0040.00815.71
7.1.230.0080.00815.72
7.1.220.0000.01115.81
7.1.210.0090.00015.52
7.1.200.0090.00315.43
7.1.190.0070.00415.36
7.1.180.0070.00715.82
7.1.170.0030.00715.57
7.1.160.0000.01215.64
7.1.150.0090.00615.58
7.1.140.0000.01315.29
7.1.130.0120.00315.55
7.1.120.0040.00815.74
7.1.110.0070.00315.45
7.1.100.0060.00915.75
7.1.90.0040.00815.73
7.1.80.0070.00315.29
7.1.70.0040.00415.55
7.1.60.0000.01215.52
7.1.50.0040.01215.48
7.1.40.0060.00615.45
7.1.30.0000.01115.64
7.1.20.0060.01215.65
7.1.10.0000.01115.43
7.1.00.0090.00315.58

preferences:
21.8 ms | 401 KiB | 5 Q