3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array(1, 2, 3, 4); //$b = array_merge(array_slice($a, 0, 2), array(5), array_slice($a, 2)); // $b = array(1, 2, 5, 3, 4) var_export( array_slice($a, 0, 2) + array(5) + array_slice($a, 2) );

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.0050.00418.87
8.4.120.0140.00720.55
8.4.110.0100.00922.51
8.4.100.0130.00917.55
8.4.90.0090.00818.79
8.4.80.0120.00717.82
8.4.70.0120.00717.88
8.4.60.0130.00718.66
8.4.50.0130.00819.50
8.4.40.0130.00617.75
8.4.30.0130.00618.66
8.4.20.0030.01617.84
8.4.10.0130.00323.82
8.3.260.0050.00616.66
8.3.250.0100.00618.86
8.3.240.0130.00516.85
8.3.230.0110.00816.74
8.3.220.0090.00817.10
8.3.210.0090.00818.44
8.3.200.0050.00316.57
8.3.190.0120.01016.53
8.3.180.0110.00818.88
8.3.170.0140.00418.84
8.3.160.0110.00718.26
8.3.150.0140.00419.07
8.3.140.0080.00016.49
8.3.130.0000.00918.52
8.3.120.0090.00018.89
8.3.110.0030.00720.94
8.3.100.0100.00618.16
8.3.90.0080.00026.77
8.3.80.0110.00016.38
8.3.70.0030.01516.63
8.3.60.0110.00416.37
8.3.50.0120.00318.25
8.3.40.0040.01120.27
8.3.30.0100.01222.07
8.3.20.0030.01024.92
8.3.10.0090.00425.16
8.3.00.0090.00525.91
8.2.290.0120.00720.31
8.2.280.0080.00818.43
8.2.270.0150.00418.94
8.2.260.0100.00716.80
8.2.250.0000.00816.38
8.2.240.0040.00417.18
8.2.230.0000.00822.58
8.2.220.0090.00024.06
8.2.210.0170.00326.77
8.2.200.0030.00618.16
8.2.190.0080.00818.54
8.2.180.0070.01325.92
8.2.170.0080.01118.70
8.2.160.0130.00322.96
8.2.150.0040.00925.66
8.2.140.0080.00525.16
8.2.130.0070.00625.91
8.2.120.0080.00422.61
8.2.110.0050.01023.96
8.2.100.0150.00420.42
8.2.90.0110.00720.98
8.2.80.0120.00920.33
8.2.70.0160.00420.33
8.2.60.0130.00318.63
8.2.50.0140.00520.47
8.2.40.0090.00721.33
8.2.30.0140.00420.42
8.2.20.0120.00621.34
8.2.10.0110.00620.45
8.2.00.0140.00320.84
8.1.330.0140.00421.63
8.1.320.0140.00515.97
8.1.310.0080.00018.24
8.1.300.0030.00617.85
8.1.290.0040.00730.84
8.1.280.0120.00625.92
8.1.270.0050.00925.16
8.1.260.0060.00526.01
8.1.250.0120.00226.88
8.1.240.0080.00823.04
8.1.230.0100.00722.51
8.1.220.0140.00520.36
8.1.210.0140.00420.77
8.1.200.0150.00420.19
8.1.190.0130.00520.16
8.1.180.0160.00220.48
8.1.170.0140.00220.63
8.1.160.0100.00720.73
8.1.150.0090.00820.66
8.1.140.0080.00820.24
8.1.130.0120.00420.20
8.1.120.0150.00220.26
8.1.110.0110.00720.29
8.1.100.0120.00520.28
8.1.90.0170.00220.24
8.1.80.0120.00620.26
8.1.70.0100.00820.27
8.1.60.0140.00420.31
8.1.50.0120.00620.30
8.1.40.0110.00720.29
8.1.30.0090.00920.29
8.1.20.0120.00620.29
8.1.10.0130.00520.24
8.1.00.0150.00420.28
8.0.300.0110.00621.06
8.0.290.0120.00820.04
8.0.280.0130.00820.58
8.0.270.0110.00720.04
8.0.260.0170.00620.10
8.0.250.0140.00420.10
8.0.240.0180.00420.10
8.0.230.0180.00520.10
8.0.220.0110.00720.10
8.0.210.0180.00320.10
8.0.200.0130.00720.10
8.0.190.0200.00720.10
8.0.180.0150.00420.10
8.0.170.0100.01020.10
8.0.160.0090.00820.10
8.0.150.0160.00620.10
8.0.140.0150.00920.10
8.0.130.0190.00320.10
8.0.120.0180.00320.10
8.0.110.0120.00620.10
8.0.100.0120.00820.10
8.0.90.0190.00420.10
8.0.80.0180.00120.10
8.0.70.0120.00520.10
8.0.60.0150.00520.10
8.0.50.0170.00420.10
8.0.30.0120.00720.10
8.0.20.0120.00620.10
8.0.10.0170.00520.10
7.4.330.0050.00922.96

preferences:
28.94 ms | 403 KiB | 5 Q