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, -6, -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.60.0030.01016.63
8.3.50.0080.01022.04
8.3.40.0070.01018.84
8.3.30.0040.01219.01
8.3.20.0070.00020.33
8.3.10.0080.00023.54
8.3.00.0070.00319.13
8.2.180.0070.00716.63
8.2.170.0120.01222.96
8.2.160.0190.00020.14
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0030.01026.16
8.2.120.0040.00422.09
8.2.110.0040.00422.27
8.2.100.0110.00017.78
8.2.90.0080.00019.22
8.2.80.0030.00517.97
8.2.70.0070.00417.63
8.2.60.0080.00017.55
8.2.50.0050.00318.07
8.2.40.0060.00318.02
8.2.30.0000.00717.98
8.2.20.0030.00617.62
8.2.10.0040.00417.93
8.2.00.0030.00717.79
8.1.280.0120.00325.92
8.1.270.0040.00423.79
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0040.00423.91
8.1.230.0040.00719.17
8.1.220.0080.00017.74
8.1.210.0000.00818.77
8.1.200.0000.00817.23
8.1.190.0040.00417.28
8.1.180.0080.00018.10
8.1.170.0080.00018.71
8.1.160.0000.00721.95
8.1.150.0070.00018.63
8.1.140.0040.00417.37
8.1.130.0030.00317.86
8.1.120.0040.00417.39
8.1.110.0060.00317.30
8.1.100.0070.00017.38
8.1.90.0000.00717.39
8.1.80.0000.00817.41
8.1.70.0000.00717.38
8.1.60.0090.00317.54
8.1.50.0040.00417.45
8.1.40.0000.00717.46
8.1.30.0040.00417.53
8.1.20.0040.00417.45
8.1.10.0030.00617.53
8.1.00.0000.00717.46
8.0.300.0080.00019.21
8.0.290.0040.00417.05
8.0.280.0000.00718.30
8.0.270.0040.00417.19
8.0.260.0030.00317.04
8.0.250.0000.00716.87
8.0.240.0030.00316.80
8.0.230.0070.00016.79
8.0.220.0030.00316.85
8.0.210.0030.00316.83
8.0.200.0000.00616.89
8.0.190.0040.00416.82
8.0.180.0000.00716.83
8.0.170.0090.00016.87
8.0.160.0070.00016.85
8.0.150.0040.00416.76
8.0.140.0070.00016.70
8.0.130.0050.00013.32
8.0.120.0040.00416.83
8.0.110.0070.00016.76
8.0.100.0000.00816.70
8.0.90.0070.00016.76
8.0.80.0060.00916.85
8.0.70.0070.00016.87
8.0.60.0050.00316.75
8.0.50.0040.00416.72
8.0.30.0130.00716.82
8.0.20.0140.00817.40
8.0.10.0040.00417.00
8.0.00.0080.00916.63
7.4.330.0000.00515.04
7.4.320.0040.00416.51
7.4.300.0000.00616.34
7.4.290.0030.00316.55
7.4.280.0030.00316.53
7.4.270.0040.00416.51
7.4.260.0030.00416.38
7.4.250.0050.00516.51
7.4.240.0040.00316.46
7.4.230.0030.00316.52
7.4.220.0090.00616.48
7.4.210.0040.01016.51
7.4.200.0070.00016.29
7.4.190.0000.00716.60
7.4.160.0100.01016.64
7.4.150.0100.00617.40
7.4.140.0120.00817.86
7.4.130.0100.00816.42
7.4.120.0110.00716.38
7.4.110.0140.00716.24
7.4.100.0110.00716.42
7.4.90.0090.00916.46
7.4.80.0130.00919.39
7.4.70.0130.00316.61
7.4.60.0060.00916.49
7.4.50.0000.00816.17
7.4.40.0130.00322.77
7.4.30.0090.00816.34
7.4.00.0000.01314.76
7.3.330.0050.00013.10
7.3.320.0030.00313.02
7.3.310.0030.00316.11
7.3.300.0030.00316.15
7.3.290.0060.00916.25
7.3.280.0130.00416.18
7.3.270.0180.00017.40
7.3.260.0060.01116.54
7.3.250.0090.01216.35
7.3.240.0090.01316.56
7.3.230.0070.01016.40
7.3.210.0130.00616.46
7.3.200.0030.01719.39
7.3.190.0100.00716.37
7.3.180.0130.00316.18
7.3.170.0100.00716.29
7.3.160.0130.00916.22
7.3.120.0000.01814.76
7.2.330.0070.01016.41
7.2.320.0060.01216.60
7.2.310.0120.00916.46
7.2.300.0070.01016.52
7.2.290.0000.01616.37
7.2.60.0040.01216.85
7.2.00.0100.00019.23
7.1.200.0060.00915.76
7.1.100.0040.00718.17
7.1.70.0000.01516.96
7.1.60.0100.01319.46
7.1.50.0070.00716.88
7.1.00.0100.07022.45
7.0.200.0200.00614.80
7.0.140.0030.07322.18
7.0.60.0030.06319.86
7.0.50.0030.06317.83
7.0.40.0030.07720.25
7.0.30.0270.07320.07
7.0.20.0200.06720.17
7.0.10.0070.08320.33
7.0.00.0130.08720.07
5.6.280.0070.07021.14
5.6.210.0030.05720.52
5.6.200.0070.03718.16
5.6.190.0100.07720.47
5.6.180.0430.07320.41
5.6.170.0130.04720.48
5.6.160.0100.03720.54
5.6.150.0070.05718.15
5.6.140.0030.04318.11
5.6.130.0070.07018.23
5.6.120.0070.03721.00
5.6.110.0070.05721.14
5.6.100.0070.08320.97
5.6.90.0070.04021.06
5.6.80.0100.07720.35
5.5.350.4330.04320.46
5.5.340.0070.06717.95
5.5.330.0070.04020.31
5.5.320.0230.03720.38
5.5.310.0400.07320.37
5.5.300.0030.07718.03
5.5.290.0030.07718.00
5.5.280.0100.08320.88
5.5.270.0200.07320.95
5.5.260.0070.08320.84
5.5.250.0000.09020.49
5.5.240.0070.07320.26
5.4.450.0600.06319.59
5.4.440.0700.05719.45
5.4.430.0700.05019.58
5.4.420.0030.06019.51
5.4.410.0270.06319.21
5.4.400.0200.05719.21
5.4.390.0130.05719.24
5.4.380.0230.05718.72
5.4.370.0300.05018.52
5.4.360.0270.05718.77
5.4.350.0400.04718.74
5.4.340.0530.05318.73
5.4.320.0070.03512.48
5.4.310.0090.03912.48
5.4.300.0060.03512.48
5.4.290.0150.03812.47
5.4.280.0110.04212.36
5.4.270.0080.04612.36
5.4.260.0090.04912.37
5.4.250.0070.04012.37
5.4.240.0060.04012.36
5.4.230.0070.05012.36
5.4.220.0120.04612.36
5.4.210.0090.04012.36
5.4.200.0160.03812.36
5.4.190.0120.04312.35
5.4.180.0120.05012.35
5.4.170.0090.04112.37
5.4.160.0050.04712.36
5.4.150.0040.03812.36
5.4.140.0090.03512.04
5.4.130.0060.04412.03
5.4.120.0090.05011.99
5.4.110.0090.03711.98
5.4.100.0090.04511.98
5.4.90.0080.03811.98
5.4.80.0120.03511.98
5.4.70.0050.03811.98
5.4.60.0060.03611.98
5.4.50.0070.03711.98
5.4.40.0040.04811.96
5.4.30.0060.03811.96
5.4.20.0090.03411.96
5.4.10.0050.03911.97
5.4.00.0080.04511.46
5.3.290.0060.03912.80
5.3.280.0120.04712.71
5.3.270.0140.05012.73
5.3.260.0150.05512.72
5.3.250.0140.06912.72
5.3.240.0150.05512.72
5.3.230.0150.05612.71
5.3.220.0140.05312.68
5.3.210.0050.04112.68
5.3.200.0090.05312.68
5.3.190.0100.03812.68
5.3.180.0090.05312.67
5.3.170.0100.05912.67
5.3.160.0110.05012.67
5.3.150.0100.05312.67
5.3.140.0100.04612.66
5.3.130.0070.04012.65
5.3.120.0080.04012.66
5.3.110.0090.04012.66
5.3.100.0060.03712.11
5.3.90.0070.03712.09
5.3.80.0070.04312.08
5.3.70.0060.04412.08
5.3.60.0070.03612.06
5.3.50.0070.03712.01
5.3.40.0120.04612.02
5.3.30.0090.05211.97
5.3.20.0080.05611.75
5.3.10.0130.05211.71
5.3.00.0080.06111.71
5.2.170.0090.0459.21
5.2.160.0070.0459.21
5.2.150.0080.0439.21
5.2.140.0070.0459.20
5.2.130.0090.0279.17
5.2.120.0080.0419.16
5.2.110.0070.0359.17
5.2.100.0040.0449.17
5.2.90.0100.0379.17
5.2.80.0090.0409.16
5.2.70.0080.0369.17
5.2.60.0120.0409.12
5.2.50.0070.0309.08
5.2.40.0050.0329.06
5.2.30.0040.0349.04
5.2.20.0050.0339.02
5.2.10.0060.0328.94
5.2.00.0050.0348.80
5.1.60.0050.0268.08
5.1.50.0060.0278.08
5.1.40.0030.0298.06
5.1.30.0050.0298.41
5.1.20.0030.0318.43
5.1.10.0050.0268.16
5.1.00.0070.0258.16
5.0.50.0080.0276.63
5.0.40.0050.0196.50
5.0.30.0040.0336.31
5.0.20.0050.0196.28
5.0.10.0020.0256.25
5.0.00.0050.0346.25
4.4.90.0040.0224.78
4.4.80.0050.0204.75
4.4.70.0080.0164.75
4.4.60.0050.0214.76
4.4.50.0050.0174.77
4.4.40.0030.0274.71
4.4.30.0030.0174.75
4.4.20.0050.0194.84
4.4.10.0100.0204.85
4.4.00.0060.0344.76
4.3.110.0040.0234.67
4.3.100.0120.0214.67
4.3.90.0090.0184.63
4.3.80.0030.0294.59
4.3.70.0030.0154.63
4.3.60.0060.0194.63
4.3.50.0050.0204.63
4.3.40.0020.0334.53
4.3.30.0010.0233.30
4.3.20.0030.0203.28
4.3.10.0020.0223.23
4.3.00.0070.0307.84

preferences:
35.59 ms | 401 KiB | 5 Q