3v4l.org

run code in 300+ PHP versions simultaneously
<?php $s1 = '{ "b": "b", "2": "2", "3": "a", "4": "4", "6": "5", "7": "6" }'; $s2 = '{ "21": "b", "2": "2", "3": "3", "4": "4", "6": "5", "7": "6" }'; $e1 = json_decode($s1,true); $e2 = json_decode($s2,true); function custom_splice(&$ar, $a, $b){ $out = array_splice($ar, $a, 1); array_splice($ar, $b, 0, $out); } function moveElement(&$array, $a, $b) { $keys = array_keys($array); custom_splice($array, $a, $b); custom_splice($keys, $a, $b); $array = array_combine($keys,$array); } moveElement($e1, 2, 0); moveElement($e2, 2, 0); print_r($e1); print_r($e2);

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.120.0120.00924.22
8.4.110.0070.00220.42
8.4.100.0080.01318.85
8.4.90.0090.01020.46
8.4.80.0070.01117.91
8.4.70.0150.00719.61
8.4.60.0110.00718.76
8.4.50.0120.00822.45
8.4.40.0070.01418.56
8.4.30.0160.00318.36
8.4.20.0090.01320.66
8.4.10.0040.00417.71
8.3.250.0110.00718.45
8.3.240.0100.01017.12
8.3.230.0090.01116.29
8.3.220.0150.00520.84
8.3.210.0080.01016.55
8.3.200.0120.01018.48
8.3.190.0100.00518.82
8.3.180.0090.01016.40
8.3.170.0120.00422.61
8.3.160.0150.00317.14
8.3.150.0180.00018.96
8.3.140.0070.01117.10
8.3.130.0070.00316.70
8.3.120.0080.00818.65
8.3.110.0060.00620.94
8.3.100.0060.00316.63
8.3.90.0110.00718.07
8.3.80.0100.00017.97
8.3.70.0140.00716.37
8.3.60.0040.01116.38
8.3.50.0120.00524.46
8.3.40.0090.00920.43
8.3.30.0070.01018.49
8.3.20.0040.00421.73
8.3.10.0030.00622.09
8.3.00.0040.00420.48
8.2.290.0070.00420.29
8.2.280.0090.00818.33
8.2.270.0100.01017.08
8.2.260.0100.00016.32
8.2.250.0120.00618.38
8.2.240.0040.00417.30
8.2.230.0050.00322.58
8.2.220.0060.00324.06
8.2.210.0110.00726.77
8.2.200.0090.00016.38
8.2.190.0110.00718.29
8.2.180.0120.00918.29
8.2.170.0100.01022.96
8.2.160.0100.00320.89
8.2.150.0000.00824.18
8.2.140.0000.00824.66
8.2.130.0070.00026.16
8.2.120.0030.00526.16
8.2.110.0000.01121.18
8.2.100.0080.00817.59
8.2.90.0080.00019.17
8.2.80.0080.00017.97
8.2.70.0050.00317.63
8.2.60.0060.00317.80
8.2.50.0060.00318.07
8.2.40.0050.00318.03
8.2.30.0050.00317.92
8.2.20.0060.00317.90
8.2.10.0000.00819.24
8.2.00.0000.00719.23
8.1.330.0100.00921.95
8.1.320.0120.00715.92
8.1.310.0040.01118.32
8.1.300.0100.01017.86
8.1.290.0000.00918.88
8.1.280.0040.01125.92
8.1.270.0050.00322.05
8.1.260.0060.00326.35
8.1.250.0070.00028.09
8.1.240.0080.00522.05
8.1.230.0070.00420.91
8.1.220.0050.00317.74
8.1.210.0000.00818.77
8.1.200.0070.00317.12
8.1.190.0060.00317.23
8.1.180.0040.00418.10
8.1.170.0060.00318.59
8.1.160.0030.00618.73
8.1.150.0040.00418.78
8.1.140.0000.00718.79
8.1.130.0040.00417.43
8.1.120.0040.00417.45
8.1.110.0080.00017.29
8.1.100.0020.00517.44
8.1.90.0070.00017.37
8.1.80.0040.00417.36
8.1.70.0000.00717.27
8.1.60.0060.00317.59
8.1.50.0040.00417.48
8.1.40.0040.00417.52
8.1.30.0040.00417.59
8.1.20.0100.00017.60
8.1.10.0040.00417.46
8.1.00.0000.00817.44
8.0.300.0070.00018.77
8.0.290.0050.00216.58
8.0.280.0070.00018.29
8.0.270.0000.00717.91
8.0.260.0000.00716.76
8.0.250.0030.00316.79
8.0.240.0000.00716.89
8.0.230.0000.00716.91
8.0.220.0040.00416.81
8.0.210.0030.00316.74
8.0.200.0030.00316.86
8.0.190.0060.00316.86
8.0.180.0000.00816.87
8.0.170.0050.00316.73
8.0.160.0050.00316.84
8.0.150.0000.00716.73
8.0.140.0040.00716.67
8.0.130.0050.00013.28
8.0.120.0040.00416.83
8.0.110.0040.00416.89
8.0.100.0090.00016.77
8.0.90.0040.00416.84
8.0.80.0070.01216.72
8.0.70.0070.00016.81
8.0.60.0070.00016.79
8.0.50.0020.00516.79
8.0.30.0030.01416.94
8.0.20.0080.01116.92
8.0.10.0040.00416.98
8.0.00.0120.00916.41
7.4.330.0000.00515.55
7.4.320.0070.00016.59
7.4.300.0040.00416.51
7.4.290.0000.00816.46
7.4.280.0000.00716.47
7.4.270.0000.00716.46
7.4.260.0000.00513.27
7.4.250.0000.00716.59
7.4.240.0020.00616.52
7.4.230.0000.00816.41
7.4.220.0000.00716.48
7.4.210.0090.00716.61
7.4.200.0030.00316.67
7.4.130.0060.01416.43
7.4.120.0100.00616.53
7.4.110.0070.01516.59
7.4.100.0160.00616.50
7.4.90.0110.00616.42
7.4.80.0070.01019.39
7.4.70.0130.00416.54
7.4.60.0060.01516.37
7.4.50.0060.01216.39
7.4.40.0080.01216.56
7.4.30.0080.01016.29
7.4.20.0120.01216.33
7.4.10.0060.01416.42
7.4.00.0090.00716.47
7.3.330.0000.00716.24
7.3.320.0060.00013.22
7.3.310.0030.00316.30
7.3.300.0040.00416.27
7.3.290.0110.00916.26
7.3.280.0070.01316.20
7.3.260.0100.00716.35
7.3.240.0100.01016.37
7.3.230.0100.00716.28
7.3.210.0100.00716.50
7.3.200.0130.00916.43
7.3.190.0190.00316.41
7.3.180.0100.00716.37
7.3.170.0090.01016.46
7.3.160.0080.00916.23
7.3.150.0080.00916.19
7.3.140.0090.00716.16
7.3.130.0080.01016.27
7.3.120.0070.00916.50
7.3.110.0080.00816.34
7.3.100.0100.00616.21
7.3.90.0120.00516.29
7.3.80.0100.00616.38
7.3.70.0040.01516.29
7.3.60.0050.01216.27
7.3.50.0110.00616.31
7.3.40.0090.00716.37
7.3.30.0060.01116.21
7.3.20.0070.01016.17
7.3.10.0060.01116.33
7.3.00.0070.01216.27
7.2.330.0120.00616.41
7.2.320.0100.00616.56
7.2.310.0100.00716.52
7.2.300.0080.01116.46
7.2.290.0120.00916.34
7.2.280.0140.00616.46
7.2.270.0080.01516.31
7.2.260.0070.01016.68
7.2.250.0070.01016.61
7.2.240.0070.01016.64
7.2.230.0100.00716.50
7.2.220.0080.00816.57
7.2.210.0080.00916.38
7.2.200.0050.01216.41
7.2.190.0080.01016.47
7.2.180.0100.00816.54
7.2.170.0050.01216.48
7.2.160.0130.00716.41
7.2.150.0040.01416.55
7.2.140.0050.01216.62
7.2.130.0090.01016.56
7.2.120.0110.00816.49
7.2.110.0120.00816.48
7.2.100.0100.00716.62
7.2.90.0050.01316.54
7.2.80.0050.01216.51
7.2.70.0110.00716.46
7.2.60.0120.00816.53
7.2.50.0110.00916.56
7.2.40.0190.01016.56
7.2.30.0050.01316.55
7.2.20.0100.00816.47
7.2.10.0160.00616.56
7.2.00.0110.00616.49

preferences:
29.95 ms | 403 KiB | 5 Q