3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [1, 2, 3, 4]; $index = 2; $value = 9; $remains = array_splice($array, max(0, $index - 1)); var_export( array_merge( $array, [$value], $remains ) );

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.4.130.0070.00417.88
8.4.120.0130.00722.49
8.4.110.0140.00718.63
8.4.100.0130.00617.60
8.4.90.0040.00517.82
8.4.80.0100.00819.26
8.4.70.0150.00519.55
8.4.60.0140.00718.54
8.4.50.0110.00918.40
8.4.40.0100.01017.68
8.4.30.0100.00718.47
8.4.20.0170.00317.92
8.4.10.0030.00623.68
8.3.260.0060.00316.25
8.3.250.0130.00618.79
8.3.240.0110.00816.21
8.3.230.0140.00516.37
8.3.220.0030.00517.17
8.3.210.0150.00416.53
8.3.200.0050.00416.63
8.3.190.0080.00718.30
8.3.180.0090.00916.72
8.3.170.0100.00918.88
8.3.160.0090.00920.22
8.3.150.0050.00316.99
8.3.140.0080.00818.61
8.3.130.0040.01218.04
8.3.120.0040.00420.84
8.3.110.0000.00820.94
8.3.100.0060.00324.06
8.3.90.0120.00626.77
8.3.80.0040.00416.38
8.3.70.0160.00616.63
8.3.60.0070.00718.56
8.3.50.0090.00618.17
8.3.40.0110.00420.01
8.3.30.0090.00618.34
8.3.20.0050.00224.18
8.3.10.0040.00424.66
8.3.00.0050.00326.16
8.2.290.0160.00320.24
8.2.280.0130.00718.30
8.2.270.0120.00617.07
8.2.260.0080.00018.57
8.2.250.0160.00319.09
8.2.240.0070.01118.77
8.2.230.0060.00922.58
8.2.220.0080.00037.54
8.2.210.0080.00026.77
8.2.200.0090.00018.29
8.2.190.0090.00616.58
8.2.180.0130.01025.92
8.2.170.0150.00318.89
8.2.160.0100.00322.96
8.2.150.0040.00425.66
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0040.00420.98
8.2.110.0030.00622.16
8.2.100.0040.00817.72
8.2.90.0030.00619.57
8.2.80.0080.00317.50
8.2.70.0030.00617.63
8.2.60.0000.00917.93
8.2.50.0060.00618.79
8.2.40.0090.00319.73
8.2.30.0050.00718.75
8.2.20.0080.00520.12
8.2.10.0040.00818.77
8.2.00.0100.00119.35
8.1.330.0090.01019.80
8.1.320.0090.01116.13
8.1.310.0100.00718.40
8.1.300.0070.00018.02
8.1.290.0050.00530.84
8.1.280.0100.00325.92
8.1.270.0070.00024.66
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0080.00320.60
8.1.230.0060.00822.75
8.1.220.0080.00017.74
8.1.210.0000.00818.81
8.1.200.0060.00317.23
8.1.190.0030.00517.23
8.1.180.0100.00318.81
8.1.170.0040.00818.99
8.1.160.0090.00319.24
8.1.150.0080.00519.07
8.1.140.0100.00318.48
8.1.130.0080.00418.47
8.1.120.0090.00418.50
8.1.110.0100.00218.48
8.1.100.0070.00718.49
8.1.90.0050.00618.45
8.1.80.0070.00718.49
8.1.70.0070.00718.49
8.1.60.0120.00118.59
8.1.50.0060.00718.57
8.1.40.0070.00618.55
8.1.30.0130.00018.52
8.1.20.0100.00218.60
8.1.10.0060.00718.48
8.1.00.0110.00218.45
8.0.300.0070.00019.98
8.0.290.0000.00716.58
8.0.280.0020.01018.94
8.0.270.0080.00318.34
8.0.260.0080.00418.24
8.0.250.0120.00018.24
8.0.240.0110.00218.24
8.0.230.0100.00218.24
8.0.220.0070.00518.24
8.0.210.0070.00518.24
8.0.200.0030.00818.24
8.0.190.0100.00218.24
8.0.180.0050.00718.24
8.0.170.0080.00418.24
8.0.160.0100.00418.24
8.0.150.0100.00218.24
8.0.140.0100.00218.24
8.0.130.0090.00318.24
8.0.120.0070.00518.24
8.0.110.0060.00518.24
8.0.100.0060.00718.24
8.0.90.0070.00418.24
8.0.80.0110.00218.24
8.0.70.0110.00218.24
8.0.60.0110.00218.24
8.0.50.0100.00218.24
8.0.30.0100.00218.24
8.0.20.0080.00318.24
8.0.10.0060.00618.24

preferences:
66.24 ms | 403 KiB | 5 Q