3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = array('test1' => 1, 'test2' => 2,'test3' => 3,'test4' => 4,'test5' => 5,'test6' => 6,'test7' => 7,'test8' => 8); $originalArray = $array1; $array2 = array('a','b','c','d','e','f','g'); /* $n = count($array1); for($x = 0; $x < $n; $x++) { array_splice($array1, 1, -$x); print_r ($array1); $array1 = $originalArray; } */ $result = array_splice($array1, -3, -2, $array2); print_r ($array1); print_r($result);

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.40.0060.00918.54
8.3.30.0120.00319.10
8.3.20.0050.00220.19
8.3.10.0080.00023.66
8.3.00.0030.00619.26
8.2.170.0100.00722.96
8.2.160.0080.00620.27
8.2.150.0000.00724.18
8.2.140.0000.00824.66
8.2.130.0140.00426.16
8.2.120.0030.00522.08
8.2.110.0070.00420.99
8.2.100.0080.00417.72
8.2.90.0040.00419.04
8.2.80.0050.00317.97
8.2.70.0050.00317.25
8.2.60.0090.00018.04
8.2.50.0080.00018.10
8.2.40.0040.00418.05
8.2.30.0040.00417.88
8.2.20.0040.00417.54
8.2.10.0020.00517.95
8.2.00.0030.00917.55
8.1.270.0040.00423.84
8.1.260.0070.00026.35
8.1.250.0060.00328.09
8.1.240.0060.00322.65
8.1.230.0100.00017.82
8.1.220.0030.00617.74
8.1.210.0050.00318.77
8.1.200.0090.00017.25
8.1.190.0040.00417.10
8.1.180.0000.00818.10
8.1.170.0030.00618.37
8.1.160.0000.00721.87
8.1.150.0040.00418.56
8.1.140.0000.00817.30
8.1.130.0000.00717.70
8.1.120.0000.00717.44
8.1.110.0030.00717.37
8.1.100.0040.00417.45
8.1.90.0040.00417.39
8.1.80.0070.00017.34
8.1.70.0040.00417.30
8.1.60.0060.00617.41
8.1.50.0000.00817.45
8.1.40.0000.00817.39
8.1.30.0030.00517.55
8.1.20.0030.00617.56
8.1.10.0040.00417.54
8.1.00.0030.00617.36
8.0.300.0040.00418.77
8.0.290.0070.00316.75
8.0.280.0050.00318.37
8.0.270.0000.00717.13
8.0.260.0030.00317.06
8.0.250.0000.00716.93
8.0.240.0030.00316.79
8.0.230.0050.00216.86
8.0.220.0000.00616.71
8.0.210.0070.00016.85
8.0.200.0030.00316.85
8.0.190.0040.00416.82
8.0.180.0000.00816.77
8.0.170.0000.00816.87
8.0.160.0070.00016.79
8.0.150.0040.00416.78
8.0.140.0000.00716.78
8.0.130.0050.00013.25
8.0.120.0000.00816.80
8.0.110.0050.00216.74
8.0.100.0040.00416.71
8.0.90.0030.00316.82
8.0.80.0030.01216.80
8.0.70.0040.00416.72
8.0.60.0040.00416.71
8.0.50.0000.00816.64
8.0.30.0090.01117.15
8.0.20.0110.00617.40
8.0.10.0080.00016.93
8.0.00.0090.00716.68
7.4.330.0060.00015.00
7.4.320.0000.00716.39
7.4.300.0060.00016.45
7.4.290.0050.00216.37
7.4.280.0040.00416.50
7.4.270.0040.00416.52
7.4.260.0030.00316.44
7.4.250.0000.00716.52
7.4.240.0010.00616.52
7.4.230.0050.00216.64
7.4.220.0090.01016.39
7.4.210.0070.00816.41
7.4.200.0070.00016.20
7.4.190.0070.00016.56
7.4.160.0100.00716.52
7.4.150.0130.00317.40
7.4.140.0110.00617.86
7.4.130.0050.01116.54
7.4.120.0060.01316.42
7.4.110.0030.01316.26
7.4.100.0090.01216.32
7.4.90.0080.00916.38
7.4.80.0100.01319.39
7.4.70.0090.01316.41
7.4.60.0090.00916.39
7.4.50.0030.00516.13
7.4.40.0030.00722.77
7.4.30.0120.00916.39
7.4.00.0080.00814.77
7.3.330.0000.00513.11
7.3.320.0050.00212.92
7.3.310.0030.00415.98
7.3.300.0000.00616.12
7.3.290.0050.01316.25
7.3.280.0090.01016.17
7.3.270.0130.00317.40
7.3.260.0160.00716.50
7.3.250.0190.00316.29
7.3.240.0090.00916.35
7.3.230.0140.00316.39
7.3.210.0070.01116.29
7.3.200.0110.00616.11
7.3.190.0030.01316.32
7.3.180.0080.00816.18
7.3.170.0070.01316.36
7.3.160.0060.01116.53
7.3.120.0060.00514.50
7.2.330.0060.01316.43
7.2.320.0030.01316.30
7.2.310.0140.00316.55
7.2.300.0050.01116.52
7.2.290.0130.00316.56
7.2.00.0070.00719.43
7.1.100.0080.00518.29
7.1.70.0000.01017.00
7.1.60.0170.00719.46
7.1.50.0040.00716.91
7.1.00.0030.07722.41
7.0.200.0190.00614.50
7.0.140.0000.07721.98
7.0.60.0000.08319.90
7.0.50.0100.08017.87
7.0.40.0030.06020.26
7.0.30.0270.04020.26
7.0.20.0300.04720.33
7.0.10.0000.05320.23
7.0.00.0000.09320.09
5.6.210.0100.07720.73
5.6.200.0070.08018.16
5.6.190.0030.08320.61
5.6.180.0370.04720.65
5.6.170.0330.04020.46
5.6.160.0030.08720.43
5.6.150.0030.04018.14
5.6.140.0130.08318.18
5.6.130.0030.05718.17
5.6.120.0100.04721.00
5.6.110.0100.06721.01
5.6.100.0100.08021.00
5.6.90.0100.05720.97
5.6.80.0200.07020.37
5.5.350.4200.04720.33
5.5.340.0070.05017.98
5.5.330.0070.04720.43
5.5.320.0300.06320.35
5.5.310.0370.05320.18
5.5.300.0100.05018.07
5.5.290.0000.04317.98
5.5.280.0070.04020.73
5.5.270.0130.07720.67
5.5.260.0200.06320.77
5.5.250.0030.09020.69
5.5.240.0070.06720.26
5.4.450.0670.04719.43
5.4.440.0800.05719.15
5.4.430.0070.06019.53
5.4.420.0170.05019.52
5.4.410.0170.05019.25
5.4.400.0130.05319.06
5.4.390.0100.05319.14
5.4.380.0270.05318.75
5.4.370.0300.05718.76
5.4.360.0330.04318.56
5.4.350.0270.05718.80
5.4.340.0270.05318.71
5.4.320.0080.03512.49
5.4.310.0090.03512.48
5.4.300.0170.04112.49
5.4.290.0050.04512.46
5.4.280.0050.04212.37
5.4.270.0060.04212.36
5.4.260.0120.05112.36
5.4.250.0120.04812.36
5.4.240.0100.04112.36
5.4.230.0120.05012.36
5.4.220.0100.06012.36
5.4.210.0060.05412.36
5.4.200.0070.04012.36
5.4.190.0060.04212.36
5.4.180.0050.04112.36
5.4.170.0060.04812.36
5.4.160.0090.04912.36
5.4.150.0070.05712.36
5.4.140.0130.05112.04
5.4.130.0080.04712.03
5.4.120.0070.05311.98
5.4.110.0090.05111.98
5.4.100.0130.04611.98
5.4.90.0070.05611.98
5.4.80.0080.05511.98
5.4.70.0090.05811.98
5.4.60.0100.04911.98
5.4.50.0100.05011.98
5.4.40.0070.06011.97
5.4.30.0140.04811.96
5.4.20.0100.04211.96
5.4.10.0060.03711.97
5.4.00.0080.03811.45
5.3.290.0070.04012.80
5.3.280.0060.04412.71
5.3.270.0100.05312.72
5.3.260.0130.04112.72
5.3.250.0100.05512.72
5.3.240.0140.06112.72
5.3.230.0140.06312.71
5.3.220.0100.05412.68
5.3.210.0140.07812.68
5.3.200.0070.06112.68
5.3.190.0100.04912.68
5.3.180.0110.04312.67
5.3.170.0060.04312.67
5.3.160.0140.04612.67
5.3.150.0130.08112.68
5.3.140.0110.05412.66
5.3.130.0100.05812.66
5.3.120.0130.05612.66
5.3.110.0150.05212.66
5.3.100.0090.04212.12
5.3.90.0040.04312.09
5.3.80.0120.03812.08
5.3.70.0110.04812.08
5.3.60.0140.04312.07
5.3.50.0190.06312.01
5.3.40.0080.06312.01
5.3.30.0110.05811.97
5.3.20.0110.05311.75
5.3.10.0140.04211.72
5.3.00.0130.06711.70
5.2.170.0090.0469.21
5.2.160.0150.0399.21
5.2.150.0130.0439.21
5.2.140.0120.0409.20
5.2.130.0130.0539.16
5.2.120.0090.0399.16
5.2.110.0070.0379.18
5.2.100.0060.0429.17
5.2.90.0100.0429.17
5.2.80.0110.0359.17
5.2.70.0070.0409.17
5.2.60.0160.0589.12
5.2.50.0090.0529.08
5.2.40.0120.0449.06
5.2.30.0060.0489.04
5.2.20.0070.0399.03
5.2.10.0130.0368.93
5.2.00.0150.0438.80
5.1.60.0050.0558.09
5.1.50.0120.0408.08
5.1.40.0070.0398.06
5.1.30.0050.0338.41
5.1.20.0040.0408.43
5.1.10.0070.0338.16
5.1.00.0090.0388.16
5.0.50.0080.0286.63
5.0.40.0050.0216.49
5.0.30.0050.0356.30
5.0.20.0090.0186.28
5.0.10.0050.0286.25
5.0.00.0090.0296.25
4.4.90.0040.0274.78
4.4.80.0040.0244.75
4.4.70.0080.0194.75
4.4.60.0030.0184.75
4.4.50.0040.0224.77
4.4.40.0060.0324.71
4.4.30.0050.0204.76
4.4.20.0030.0244.84
4.4.10.0030.0224.85
4.4.00.0040.0344.76
4.3.110.0100.0174.66
4.3.100.0080.0194.67
4.3.90.0110.0204.63
4.3.80.0150.0434.59
4.3.70.0050.0184.63
4.3.60.0050.0214.63
4.3.50.0030.0264.63
4.3.40.0050.0324.54
4.3.30.0060.0183.30
4.3.20.0040.0213.27
4.3.10.0030.0213.23
4.3.00.0100.0237.77

preferences:
39.2 ms | 400 KiB | 5 Q