3v4l.org

run code in 300+ PHP versions simultaneously
<?php function shiftPop(array $indexedArray, int $shiftPopsCount): array { $count = count($indexedArray); if ($count < 2) { return $indexedArray; } $remainder = $shiftPopsCount % $count; if (!$remainder) { return $indexedArray; } return array_merge( array_splice($indexedArray, $remainder), $indexedArray ); } $array = [1, 2, 3, 4]; foreach (range(0, 9) as $moves) { var_export(shiftPop($array, $moves)); echo "\n---\n"; }

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.00.0140.00720.18
8.4.150.0020.00114.05
8.4.140.0140.00719.21
8.4.130.0050.00317.98
8.4.120.0110.00920.65
8.4.110.0120.00922.49
8.4.100.0090.01117.75
8.4.90.0070.00318.71
8.4.80.0070.00217.83
8.4.70.0060.01017.67
8.4.60.0140.00720.60
8.4.50.0080.00317.64
8.4.40.0030.01719.30
8.4.30.0090.00920.33
8.4.20.0130.00720.48
8.4.10.0090.00022.13
8.3.280.0130.00818.36
8.3.270.0120.00916.60
8.3.260.0090.01116.45
8.3.250.0050.00418.76
8.3.240.0100.00716.72
8.3.230.0130.00616.34
8.3.220.0050.00317.07
8.3.210.0150.00716.38
8.3.200.0090.00216.44
8.3.190.0110.00417.16
8.3.180.0100.00716.37
8.3.170.0120.00616.46
8.3.160.0190.00016.60
8.3.150.0150.00717.01
8.3.140.0110.00716.37
8.3.130.0040.00418.41
8.3.120.0080.00820.68
8.3.110.0040.00420.94
8.3.100.0130.00316.38
8.3.90.0110.00426.77
8.3.80.0000.01016.50
8.3.70.0130.00616.63
8.3.60.0070.01016.50
8.3.50.0100.00720.22
8.3.40.0030.01020.47
8.3.30.0100.00718.67
8.3.20.0000.00824.18
8.3.10.0030.00524.66
8.3.00.0070.00026.16
8.2.290.0110.00820.21
8.2.280.0110.00718.39
8.2.270.0090.00616.59
8.2.260.0030.01518.85
8.2.250.0070.01318.44
8.2.240.0000.00817.10
8.2.230.0060.00322.58
8.2.220.0060.00324.06
8.2.210.0080.00026.77
8.2.200.0000.01116.50
8.2.190.0140.00716.63
8.2.180.0180.00025.92
8.2.170.0090.00619.00
8.2.160.0040.01122.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0000.00826.16
8.2.120.0000.00820.95
8.2.110.0030.00620.52
8.2.100.0070.00717.90
8.2.90.0090.00017.75
8.2.80.0040.00418.91
8.2.70.0040.00417.50
8.2.60.0040.00417.93
8.2.50.0050.00318.07
8.2.40.0040.00419.97
8.2.30.0040.00518.00
8.2.20.0070.00020.54
8.2.10.0000.00818.13
8.2.00.0000.00719.19
8.1.330.0150.00522.01
8.1.320.0060.01416.08
8.1.310.0090.00618.41
8.1.300.0060.00317.99
8.1.290.0060.00330.84
8.1.280.0120.00325.92
8.1.270.0030.00524.66
8.1.260.0040.00426.35
8.1.250.0030.00528.09
8.1.240.0000.01023.86
8.1.230.0000.01220.96
8.1.220.0040.00417.79
8.1.210.0080.00018.77
8.1.200.0070.00317.22
8.1.190.0030.00617.22
8.1.180.0050.00318.10
8.1.170.0030.00618.63
8.1.160.0000.00920.64
8.1.150.0040.00418.64
8.1.140.0000.00717.40
8.1.130.0030.00519.20
8.1.120.0000.00817.50
8.1.110.0000.00717.43
8.1.100.0040.00417.52
8.1.90.0080.00017.39
8.1.80.0040.00417.48
8.1.70.0030.00617.43
8.1.60.0120.00617.59
8.1.50.0120.00417.51
8.1.40.0130.00317.41
8.1.30.0110.00817.64
8.1.20.0150.00217.64
8.1.10.0060.00917.53
8.1.00.0080.00317.39
8.0.300.0040.00418.93
8.0.290.0080.00016.75
8.0.280.0040.00418.40
8.0.270.0000.00816.83
8.0.260.0030.00316.74
8.0.250.0070.00017.00
8.0.240.0080.00017.03
8.0.230.0000.00716.85
8.0.220.0030.00316.91
8.0.210.0040.00416.98
8.0.200.0100.00016.96
8.0.190.0100.00016.85
8.0.180.0060.00316.80
8.0.170.0050.00516.79
8.0.160.0080.00416.79
8.0.150.0070.00716.64
8.0.140.0150.00016.85
8.0.130.0070.00716.66
8.0.120.0100.00416.83
8.0.110.0100.00316.78
8.0.100.0110.00316.89
8.0.90.0090.00616.91
8.0.80.0100.00516.87
8.0.70.0090.00616.89
8.0.60.0080.00316.71
8.0.50.0100.00316.79
8.0.30.0100.00316.86
8.0.20.0060.00516.84
8.0.10.0130.00016.96
7.4.330.0050.00015.55
7.4.320.0040.00416.50
7.4.300.0130.00016.48
7.4.290.0160.00016.50
7.4.280.0170.00016.43
7.4.270.0030.01316.59
7.4.260.0120.00216.40
7.4.250.0120.00316.45
7.4.240.0120.00316.47
7.4.230.0110.00416.54
7.4.220.0070.00716.40
7.4.210.0110.00016.60
7.4.200.0040.00716.57
7.4.190.0090.00516.70
7.4.180.0140.00016.64
7.4.160.0110.00416.60
7.4.150.0090.00316.61
7.4.140.0060.00616.38
7.4.130.0040.00716.21
7.4.120.0080.00016.38
7.4.110.0090.00016.45
7.4.100.0090.00316.40
7.4.90.0000.00816.38
7.4.80.0080.00016.47
7.4.70.0060.00316.38
7.4.60.0080.00016.52
7.4.50.0050.00516.34
7.4.40.0080.00416.47
7.4.30.0040.00816.41
7.4.20.0060.00616.43
7.4.10.0060.00616.55
7.4.00.0090.00316.43

preferences:
133.32 ms | 403 KiB | 5 Q