3v4l.org

run code in 300+ PHP versions simultaneously
<?php // This code is public domain. The original author is Marc Ermshaus. error_reporting(-1); /** * Circularly shifts an array * * Shifts to right for $steps > 0. Shifts to left for $steps < 0. Keys are * preserved. * * @param array $array Array to shift * @param int $steps Steps to shift array by * @return array Resulting array */ function array_circular(array $array, $steps = 1) { return array_merge(array_slice($array, $steps), array_slice($array, 0, $steps)); } header('content-type: text/plain'); $a = array("1" => "Primeiro", "2"=>"Segundo", "3"=>"Terceiro", "4"=> "Quarto"); $l = sizeof($a); for ($i = 0 ; $i < $l; $i++) { printf("% 3s : %s\n", $i, implode(', ', array_shift_circular($a, $i))); } ?>

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.0150.00416.50
8.3.60.0120.00318.43
8.3.50.0100.01018.28
8.3.40.0120.00318.75
8.3.30.0120.00318.80
8.3.20.0060.00319.27
8.3.10.0020.00519.34
8.3.00.0080.00023.51
8.2.180.0090.00618.28
8.2.170.0110.00422.96
8.2.160.0070.00722.00
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0040.00419.77
8.2.120.0070.00026.35
8.2.110.0070.00421.18
8.2.100.0070.00717.75
8.2.90.0040.00420.38
8.2.80.0070.00017.97
8.2.70.0080.00017.93
8.2.60.0060.00318.22
8.2.50.0000.00818.10
8.2.40.0040.00419.34
8.2.30.0000.00819.48
8.2.20.0020.00518.14
8.2.10.0040.00418.03
8.2.00.0070.00019.56
8.1.280.0150.00025.92
8.1.270.0040.00423.90
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0060.00321.98
8.1.230.0070.00418.95
8.1.220.0050.00317.79
8.1.210.0050.00318.77
8.1.200.0000.00917.48
8.1.190.0000.00817.25
8.1.180.0040.00418.10
8.1.170.0000.00718.57
8.1.160.0040.00418.87
8.1.150.0000.00718.82
8.1.140.0000.00717.57
8.1.130.0070.00019.01
8.1.120.0000.00717.43
8.1.110.0090.00017.52
8.1.100.0040.00417.43
8.1.90.0030.00617.51
8.1.80.0000.00717.36
8.1.70.0000.00817.48
8.1.60.0000.01017.49
8.1.50.0040.00417.50
8.1.40.0000.00717.48
8.1.30.0040.00417.70
8.1.20.0050.00317.64
8.1.10.0040.00417.44
8.1.00.0030.00617.50
8.0.300.0070.00018.77
8.0.290.0060.00316.63
8.0.280.0040.00418.38
8.0.270.0070.00017.15
8.0.260.0030.00317.18
8.0.250.0070.00016.96
8.0.240.0030.00316.95
8.0.230.0000.00716.89
8.0.220.0000.00716.83
8.0.210.0000.00716.78
8.0.200.0030.00316.91
8.0.190.0080.00016.95
8.0.180.0030.00316.84
8.0.170.0000.01017.03
8.0.160.0000.00716.93
8.0.150.0030.00716.90
8.0.140.0040.00316.92
8.0.130.0030.00313.38
8.0.120.0060.00316.84
8.0.110.0000.00716.97
8.0.100.0040.00416.83
8.0.90.0040.00416.78
8.0.80.0130.00716.88
8.0.70.0000.00816.91
8.0.60.0050.00216.81
8.0.50.0020.00516.84
8.0.30.0120.00717.08
8.0.20.0100.00917.40
8.0.10.0000.00816.91
8.0.00.0090.01016.86
7.4.330.0040.00015.55
7.4.320.0030.00316.52
7.4.300.0000.00716.52
7.4.290.0000.00716.61
7.4.280.0040.00416.59
7.4.270.0070.00016.49
7.4.260.0000.00616.59
7.4.250.0000.00716.57
7.4.240.0080.00016.59
7.4.230.0070.00016.60
7.4.220.0040.00416.42
7.4.210.0090.00816.50
7.4.200.0050.00216.58
7.4.160.0090.00816.55
7.4.140.0120.00517.86
7.4.130.0060.01216.54
7.4.120.0100.01216.50
7.4.110.0040.01116.58
7.4.100.0060.01016.51
7.4.90.0130.01016.66
7.4.80.0070.01019.39
7.4.70.0050.01316.48
7.4.60.0100.00716.45
7.4.50.0030.01416.40
7.4.40.0160.00716.49
7.4.10.0060.01314.80
7.4.00.0070.01014.85
7.3.330.0000.00513.28
7.3.320.0030.00313.30
7.3.310.0030.00316.33
7.3.300.0050.00216.19
7.3.290.0000.00616.23
7.3.280.0030.01116.33
7.3.260.0080.00916.29
7.3.240.0090.00916.51
7.3.230.0030.01516.33
7.3.210.0070.01016.42
7.3.200.0060.00916.27
7.3.190.0140.00716.36
7.3.180.0090.01216.57
7.3.170.0090.00916.34
7.3.160.0000.01816.43
7.3.130.0000.01714.57
7.3.120.0060.01214.81
7.3.110.0130.00314.72
7.3.100.0140.00314.67
7.3.90.0030.01315.01
7.3.80.0070.00414.54
7.3.70.0100.00314.66
7.3.60.0070.00314.90
7.3.50.0030.01014.95
7.3.40.0000.00814.65
7.3.30.0000.00814.96
7.3.20.0120.00016.72
7.3.10.0070.01016.60
7.3.00.0080.00816.61
7.2.330.0040.01416.58
7.2.320.0080.00816.52
7.2.310.0150.00316.40
7.2.300.0110.00716.41
7.2.290.0070.01116.57
7.2.260.0070.01114.96
7.2.250.0070.00714.93
7.2.240.0070.00714.55
7.2.230.0030.01215.27
7.2.220.0070.00314.87
7.2.210.0110.00315.18
7.2.200.0000.01014.70
7.2.190.0090.00614.85
7.2.180.0060.00314.91
7.2.170.0000.01314.92
7.2.160.0030.00614.84
7.2.150.0100.00316.59
7.2.140.0070.01016.72
7.2.130.0030.00616.57
7.2.120.0080.00816.82
7.2.110.0050.00516.92
7.2.100.0120.00616.85
7.2.90.0070.00716.84
7.2.80.0060.00316.73
7.2.70.0100.00316.75
7.2.60.1190.00715.77
7.2.50.0080.01215.86
7.2.40.0060.01016.14
7.2.30.0080.01116.05
7.2.20.1260.00716.06
7.2.10.1280.00915.96
7.2.00.1200.00716.12
7.1.330.0130.00315.77
7.1.320.0100.00615.90
7.1.310.0000.00815.92
7.1.300.0110.00415.85
7.1.290.0060.00315.88
7.1.280.0080.00415.84
7.1.270.0030.01015.65
7.1.260.0100.00315.76
7.1.250.0060.00615.73
7.1.240.0040.01215.66
7.1.230.0030.01215.67
7.1.220.0130.00315.94
7.1.210.0140.00315.86
7.1.200.0060.00615.88
7.1.190.0060.00615.98
7.1.180.0070.01015.57
7.1.170.0110.01114.61
7.1.160.0110.00816.47
7.1.150.0160.00716.46
7.1.140.0680.00616.46
7.1.130.1460.00916.31
7.1.120.1170.00416.37
7.1.110.1350.00715.89
7.1.100.1240.01116.03
7.1.90.0130.00616.12
7.1.80.0080.01216.14
7.1.70.0090.01015.65
7.1.60.0760.01324.60
7.1.50.0230.00724.32
7.1.40.0220.01324.18
7.1.30.0470.01424.14
7.1.20.0230.01124.26
7.1.10.1300.00815.28
7.1.00.0090.00915.44
7.0.330.0090.00315.61
7.0.320.0080.00815.17
7.0.310.0030.00915.63
7.0.300.0030.01415.31
7.0.290.0000.00815.47
7.0.280.0040.01115.38
7.0.270.0040.01115.48
7.0.260.0000.01015.41
7.0.250.0110.00415.47
7.0.240.0030.01015.43
7.0.230.0030.01315.54
7.0.220.0000.00815.25
7.0.210.0030.01015.55
7.0.200.0030.01015.61
7.0.190.0040.00815.46
7.0.180.0000.01315.47
7.0.170.0080.00415.34
7.0.160.0090.00315.39
7.0.150.0080.00815.21
7.0.140.0070.00415.49
7.0.130.0060.01015.23
7.0.120.0060.00615.50
7.0.110.0000.00815.47
7.0.100.0100.00315.40
7.0.90.0070.00415.54
7.0.80.0060.00715.40
7.0.70.0070.00315.26
7.0.60.0000.01515.42
7.0.50.0050.00315.57
7.0.40.0090.00013.57
7.0.30.0040.01113.37
7.0.20.0000.01213.41
7.0.10.0030.01313.48
7.0.00.0070.01113.50
5.6.400.0040.01113.78
5.6.390.0070.00714.46
5.6.380.0070.01114.30
5.6.370.0090.00314.32
5.6.360.0060.00614.62
5.6.350.0000.01114.24
5.6.340.0120.00314.48
5.6.330.0040.00814.30
5.6.320.0040.01114.33
5.6.310.0070.00714.36
5.6.300.0000.01414.15
5.6.290.0040.00814.39
5.6.280.0000.00914.69
5.6.270.0000.01014.46
5.6.260.0090.00314.20
5.6.250.0050.00314.18
5.6.240.0000.01114.34
5.6.230.0030.01414.36
5.6.220.0060.00614.32
5.6.210.0000.01014.18
5.6.200.0090.00414.16
5.6.190.0030.00614.23
5.6.180.0000.01914.48
5.6.170.0060.01214.03
5.6.160.0100.00314.41
5.6.150.0090.00914.34
5.6.140.0060.01014.26
5.6.130.0060.00614.54
5.6.120.0060.00614.49
5.6.110.0040.01214.43
5.6.100.0080.00414.44
5.6.90.0070.00714.36
5.6.80.0090.00614.15
5.6.70.0030.01514.10
5.6.60.0070.01014.12
5.6.50.0030.01014.11
5.6.40.0110.00314.13
5.6.30.0090.00614.23
5.6.20.0030.01314.17
5.6.10.0080.00814.05
5.6.00.0040.01114.13

preferences:
62.65 ms | 400 KiB | 5 Q