3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(-1); $total = 12; $skip = 4; $numberLeft = 1; for ($i = 1; $i <= $total; $i++){ $positions[$i] = $i; } for ($i = $total; $i >= $skip; $i--){ if ($total - $numberLeft < $skip - 1){ $numberLeft = $skip - ($total - $numberLeft) - 1; } else { $numberLeft = $numberLeft + $skip - 1; } for($j = $numberLeft; $j < $total; $j++){ $positions[$j] = $positions[$j+1]; } unset($positions[$total]); $total--; } echo "Выигрышные места: ".implode(", ", $positions);

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.0090.00618.38
8.3.50.0090.00616.45
8.3.40.0150.00018.52
8.3.30.0070.00718.83
8.3.20.0040.00420.25
8.3.10.0000.00821.80
8.3.00.0000.00821.02
8.2.180.0150.00018.29
8.2.170.0070.00722.96
8.2.160.0070.00719.39
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0000.00819.83
8.2.120.0040.00426.35
8.2.110.0070.00320.97
8.2.100.0070.00418.22
8.2.90.0060.00319.20
8.2.80.0040.00417.97
8.2.70.0050.00317.63
8.2.60.0040.00418.03
8.2.50.0040.00418.16
8.2.40.0040.00420.47
8.2.30.0060.00319.20
8.2.20.0000.00718.13
8.2.10.0030.00518.07
8.2.00.0080.00018.02
8.1.280.0140.00325.92
8.1.270.0070.00022.05
8.1.260.0000.00726.35
8.1.250.0070.00028.09
8.1.240.0030.00722.74
8.1.230.0070.00420.35
8.1.220.0050.00317.79
8.1.210.0060.00318.77
8.1.200.0060.00317.38
8.1.190.0060.00317.23
8.1.180.0040.00418.10
8.1.170.0040.00418.65
8.1.160.0050.00318.83
8.1.150.0040.00420.15
8.1.140.0020.00519.52
8.1.130.0100.00018.83
8.1.120.0000.00817.45
8.1.110.0070.00017.26
8.1.100.0030.00517.33
8.1.90.0040.00417.48
8.1.80.0000.00817.43
8.1.70.0030.00317.38
8.1.60.0030.00617.61
8.1.50.0040.00417.36
8.1.40.0030.00617.31
8.1.30.0000.00917.68
8.1.20.0040.00417.60
8.1.10.0060.00317.49
8.1.00.0000.00917.50
8.0.300.0050.00319.21
8.0.290.0000.00716.63
8.0.280.0000.00718.46
8.0.270.0000.00716.75
8.0.260.0000.00818.84
8.0.250.0000.00717.00
8.0.240.0070.00017.01
8.0.230.0040.00416.94
8.0.220.0000.00716.82
8.0.210.0000.00716.89
8.0.200.0000.00616.90
8.0.190.0080.00016.86
8.0.180.0000.00816.85
8.0.170.0040.00416.82
8.0.160.0050.00216.97
8.0.150.0030.00516.74
8.0.140.0040.00416.82
8.0.130.0050.00013.42
8.0.120.0050.00316.87
8.0.110.0050.00316.84
8.0.100.0030.00516.71
8.0.90.0000.00716.80
8.0.80.0100.00916.73
8.0.70.0040.00416.71
8.0.60.0050.00316.85
8.0.50.0030.00316.79
8.0.30.0090.01117.26
8.0.20.0120.00817.40
8.0.10.0000.00716.98
8.0.00.0150.00916.79
7.4.330.0000.00515.55
7.4.320.0060.00016.42
7.4.300.0000.00716.48
7.4.290.0030.00316.63
7.4.280.0000.00816.48
7.4.270.0030.00316.57
7.4.260.0000.00816.40
7.4.250.0030.00316.50
7.4.240.0070.00016.56
7.4.230.0040.00416.33
7.4.220.0090.00916.34
7.4.210.0090.00916.68
7.4.200.0000.00816.45
7.4.160.0130.00616.49
7.4.150.0080.01017.40
7.4.140.0090.00717.86
7.4.130.0030.01416.70
7.4.120.0080.01016.48
7.4.110.0090.01716.68
7.4.100.0120.00316.36
7.4.90.0060.01216.41
7.4.80.0180.00919.39
7.4.70.0100.00716.55
7.4.60.0080.00916.52
7.4.50.0090.00416.55
7.4.40.0090.01416.44
7.4.30.0060.01016.50
7.4.00.0090.00614.86
7.3.330.0020.00213.26
7.3.320.0000.00513.13
7.3.310.0000.00716.34
7.3.300.0060.00016.29
7.3.290.0090.00716.31
7.3.280.0070.00816.32
7.3.270.0090.00917.40
7.3.260.0090.01016.36
7.3.250.0100.00916.41
7.3.240.0100.00816.54
7.3.230.0060.01016.31
7.3.210.0130.00316.29
7.3.200.0120.00816.70
7.3.190.0090.00716.47
7.3.180.0130.00316.61
7.3.170.0090.00916.36
7.3.160.0080.00816.36
7.3.10.0000.01316.41
7.3.00.0090.00616.54
7.2.330.0030.01416.54
7.2.320.0030.01316.53
7.2.310.0110.00916.66
7.2.300.0030.02016.72
7.2.290.0070.01116.88
7.2.130.0030.00616.94
7.2.120.0070.00716.66
7.2.110.0070.01016.99
7.2.100.0040.01117.02
7.2.90.0070.00317.11
7.2.80.0090.00616.81
7.2.70.0000.01316.91
7.2.60.0110.00316.97
7.2.50.0090.00916.92
7.2.40.0080.00516.75
7.2.30.0000.01617.05
7.2.20.0120.00616.99
7.2.10.0030.00917.07
7.2.00.0030.01317.02
7.1.250.0110.00015.69
7.1.200.0030.01015.88
7.1.80.3380.00616.30
7.1.70.0150.01215.29
7.1.60.6510.02033.32
7.1.50.0360.01532.76
7.1.40.9130.01332.82
7.1.30.8290.01932.77
7.1.20.8740.01932.82
7.1.10.8950.02114.57
7.1.00.8840.01214.93
7.0.200.0140.01414.91
7.0.190.2070.00714.99
7.0.180.0080.01414.41
7.0.170.9160.01814.48
7.0.161.4490.00614.37
7.0.150.8700.01414.25
7.0.140.9660.00914.47
7.0.130.9470.01314.72
7.0.120.8820.01014.85
7.0.110.8300.00714.50
7.0.100.8650.00614.46
7.0.90.8820.00614.57
7.0.80.9040.01014.81
7.0.70.9560.01214.59
7.0.60.7720.01114.52
7.0.50.8060.01014.64
7.0.40.7770.01214.60
7.0.30.6930.01814.61
7.0.20.6700.00614.56
7.0.10.6610.01514.68
7.0.00.5780.01614.54

preferences:
40.07 ms | 400 KiB | 5 Q