3v4l.org

run code in 500+ PHP versions simultaneously
<?php $arr = [2,5,1,12,-5,4,-1,3,-3,20,8,7,-2,6,9]; $a = $arr; asort($a); $a = array_chunk($a, 5); $output = []; $idx = 0; while($a){ if($idx++ % 2){ $b = array_pop($a); arsort($b); }else{ $b = array_shift($a); } $output = array_merge($output, $b); } var_dump($output);

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.5.70.0080.00918.55
8.5.60.0130.00516.79
8.5.50.0070.00716.64
8.5.30.0100.00719.04
8.5.20.0030.00519.60
8.5.10.0070.00116.59
8.5.00.0050.00520.14
8.4.210.0140.00921.27
8.4.180.0080.01519.64
8.4.170.0150.00819.59
8.4.160.0110.01023.98
8.4.150.0050.00716.82
8.4.140.0160.00817.48
8.4.130.0120.00918.86
8.4.120.0050.00324.00
8.4.110.0100.01118.87
8.4.100.0130.00818.75
8.4.90.0100.01020.60
8.4.80.0120.00718.64
8.4.70.0140.00718.89
8.4.60.0120.01018.97
8.4.50.0050.00518.40
8.4.40.0060.00317.52
8.4.30.0100.01020.59
8.4.20.0070.01317.94
8.4.10.0030.00619.49
8.3.300.0110.01220.36
8.3.290.0120.00720.82
8.3.280.0120.00818.40
8.3.270.0120.00916.72
8.3.260.0030.00516.77
8.3.250.0120.00618.77
8.3.240.0070.00717.16
8.3.230.0060.00216.73
8.3.220.0110.00818.85
8.3.210.0040.00418.46
8.3.200.0050.00416.61
8.3.190.0070.01219.03
8.3.180.0090.00918.82
8.3.170.0180.00018.88
8.3.160.0150.00317.11
8.3.150.0050.00316.66
8.3.140.0090.00917.04
8.3.130.0060.00318.19
8.3.120.0030.00520.67
8.3.110.0050.00316.38
8.3.100.0070.00416.50
8.3.90.0000.00826.77
8.3.80.0040.00716.52
8.3.70.0040.01116.63
8.3.60.0100.01316.63
8.3.50.0110.00418.18
8.3.40.0120.00318.63
8.3.30.0150.00618.57
8.3.20.0050.00324.18
8.3.10.0030.01424.66
8.3.00.0030.00526.16
8.2.300.0150.00722.16
8.2.290.0160.00620.35
8.2.280.0070.00120.28
8.2.270.0070.01116.67
8.2.260.0170.00316.45
8.2.250.0030.00618.21
8.2.240.0060.00318.69
8.2.230.0030.00520.94
8.2.220.0060.00324.06
8.2.210.0040.00426.77
8.2.200.0000.01016.50
8.2.190.0110.00416.58
8.2.180.0060.00925.92
8.2.170.0150.00718.97
8.2.160.0170.00322.96
8.2.150.0190.00025.66
8.2.140.0140.00424.66
8.2.130.0040.00426.16
8.2.120.0050.00326.16
8.2.110.0090.00022.15
8.2.100.0080.00417.72
8.2.90.0030.00517.91
8.2.80.0040.00419.17
8.2.70.0030.00518.04
8.2.60.0040.00417.89
8.2.50.0030.00618.10
8.2.40.0070.00019.34
8.2.30.0040.00417.59
8.2.20.0040.00420.66
8.2.10.0040.00417.61
8.2.00.0040.00419.21
8.1.340.0160.00517.57
8.1.330.0090.00321.85
8.1.320.0110.00816.19
8.1.310.0090.00015.93
8.1.300.0090.00018.06
8.1.290.0030.00630.84
8.1.280.0200.00325.92
8.1.270.0000.01123.99
8.1.260.0090.00626.35
8.1.250.0000.00828.09
8.1.240.0080.00022.06
8.1.230.0160.00020.97
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0060.00317.35
8.1.190.0000.00817.23
8.1.180.0000.00818.10
8.1.170.0000.00818.65
8.1.160.0000.00718.71
8.1.150.0030.00518.59
8.1.140.0040.00417.32
8.1.130.0040.00417.44
8.1.120.0030.00317.43
8.1.110.0050.00317.29
8.1.100.0040.00417.31
8.1.90.0000.00817.40
8.1.80.0000.00817.46
8.1.70.0000.00717.45
8.1.60.0080.00017.43
8.1.50.0040.00417.38
8.1.40.0030.00517.35
8.1.30.0000.00817.51
8.1.20.0080.00017.59
8.1.10.0060.00317.48
8.1.00.0040.00417.47
8.0.300.0070.00020.12
8.0.290.0000.00816.63
8.0.280.0040.00418.42
8.0.270.0000.00716.83
8.0.260.0000.00816.75
8.0.250.0060.00016.87
8.0.240.0000.00616.90
8.0.230.0000.00716.82
8.0.220.0040.00416.89
8.0.210.0000.00816.96
8.0.200.0000.00816.98
8.0.190.0080.00016.85
8.0.180.0030.00616.82
8.0.170.0040.00416.80
8.0.160.0070.00016.74
8.0.150.0000.00716.84
8.0.140.0050.00216.91
8.0.130.0130.00916.88
8.0.120.0210.00816.76
8.0.110.0150.00716.81
8.0.100.0120.00816.77
8.0.90.0180.00216.71
8.0.80.0100.01016.90
8.0.70.0120.00916.76
8.0.60.0190.00016.92
8.0.50.0170.00316.81
8.0.30.0180.00216.73
8.0.20.0150.00516.79
8.0.10.0170.00416.98
8.0.00.0110.00016.97
7.4.330.0000.00515.55
7.4.320.0070.00016.45
7.4.300.0000.00616.40
7.4.290.0030.00316.39
7.4.280.0000.00816.55
7.4.270.0000.00716.52
7.4.260.0130.00916.40
7.4.250.0200.00016.42
7.4.240.0160.00516.34
7.4.230.0210.00316.32
7.4.220.0120.00916.52
7.4.210.0160.00316.46
7.4.200.0180.00016.44
7.4.190.0110.00716.34
7.4.180.0160.00316.47
7.4.160.0160.00316.45
7.4.150.0150.00516.43
7.4.140.0150.00616.28
7.4.130.0170.00316.39
7.4.120.0140.00816.41
7.4.110.0140.00516.43
7.4.100.0170.00316.44
7.4.90.0180.00316.20
7.4.80.0120.00816.36
7.4.70.0210.00016.35
7.4.60.0130.00616.26
7.4.50.0130.00616.44
7.4.40.0200.00016.27
7.4.30.0110.00616.42
7.4.20.0140.00516.25
7.4.10.0030.00516.26
7.4.00.0030.00316.45
7.3.330.0060.00016.35
7.3.320.0050.00516.33
7.3.310.0080.00016.07
7.3.300.0030.00616.11
7.3.290.0000.00916.19
7.3.280.0080.00616.34
7.3.270.0090.00316.11
7.3.260.0140.00316.29
7.3.250.0060.00616.32
7.3.240.0070.00416.33
7.3.230.0120.00016.30
7.3.220.0030.00316.28
7.3.210.0140.00716.05
7.3.200.0140.00516.28
7.3.190.0110.01016.28
7.3.180.0150.00416.27
7.3.170.0150.00416.24
7.3.160.0180.00416.14
7.3.150.0200.00016.12
7.3.140.0120.00816.03
7.3.130.0150.00516.24
7.3.120.0120.00616.29
7.3.110.0130.00816.01
7.3.100.0110.01116.08
7.3.90.0130.00516.40
7.3.80.0030.00615.98
7.3.70.0080.00016.16
7.3.60.0000.00716.22
7.3.50.0000.00916.50
7.3.40.0070.00216.29
7.3.30.0090.00316.20
7.3.20.0060.00618.25
7.3.10.0080.00418.17
7.3.00.0090.00417.96

preferences:
33.81 ms | 1449 KiB | 5 Q