3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json1 = '[{"one": "u0001u0000u0000u0000", "two": "u0002u0000u0000u0000", "three": "u0003u0000u0000u0000"}]'; $json2 = '[{ "a": { "one": "u0001u0000u0000u0000", "two": "u0002u0000u0000u0000", "three": "u0003u0000u0000u0000" } }]'; $arr1 = json_decode($json1,true); $arr2 = json_decode($json2,true); foreach($arr1 as $data){ $default1[] = implode($data); } $default1 = json_encode($default1, JSON_FORCE_OBJECT); foreach($arr2 as $key => $child){ foreach($child as $childKey => $data){ $default2[$childKey] = implode($data); } } $default2 = json_encode($default2, JSON_FORCE_OBJECT); print_r($default1); print_r($default2);

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.130.0000.00818.57
8.3.120.0090.00018.80
8.3.110.0090.00018.43
8.3.100.0130.00324.06
8.3.90.0060.00326.77
8.3.80.0100.00019.36
8.3.70.0120.00318.18
8.3.60.0120.00918.43
8.3.50.0060.00718.03
8.3.40.0070.00718.58
8.3.30.0040.01118.79
8.3.20.0080.00019.33
8.3.10.0050.00323.48
8.3.00.0040.00423.36
8.2.250.0080.00017.01
8.2.240.0030.00716.94
8.2.230.0060.00620.94
8.2.220.0080.00837.54
8.2.210.0040.00426.77
8.2.200.0030.00718.88
8.2.190.0070.01116.58
8.2.180.0100.00718.16
8.2.170.0160.00022.96
8.2.160.0100.00319.04
8.2.150.0000.00724.18
8.2.140.0040.00424.66
8.2.130.0080.00020.52
8.2.120.0000.00826.35
8.2.110.0030.00622.23
8.2.100.0040.00717.77
8.2.90.0090.00017.75
8.2.80.0040.00417.97
8.2.70.0040.00418.00
8.2.60.0080.00018.09
8.2.50.0060.00319.48
8.2.40.0040.00419.46
8.2.30.0000.00920.63
8.2.20.0030.00618.16
8.2.10.0040.00418.00
8.2.00.0090.00019.49
8.1.300.0000.00916.16
8.1.290.0070.00430.84
8.1.280.0130.01325.92
8.1.270.0060.00923.91
8.1.260.0000.00726.35
8.1.250.0070.00028.09
8.1.240.0060.00318.89
8.1.230.0040.00820.78
8.1.220.0040.00417.79
8.1.210.0030.00618.77
8.1.200.0030.00617.38
8.1.190.0030.00517.13
8.1.180.0060.00318.10
8.1.170.0030.00618.65
8.1.160.0040.00418.90
8.1.150.0070.00018.95
8.1.140.0050.00318.94
8.1.130.0030.00319.00
8.1.120.0030.00317.48
8.1.110.0030.00517.45
8.1.100.0070.00317.42
8.1.90.0000.00717.48
8.1.80.0040.00417.36
8.1.70.0000.00817.41
8.1.60.0040.00717.61
8.1.50.0040.00817.56
8.1.40.0000.00817.39
8.1.30.0050.00317.55
8.1.20.0030.00617.66
8.1.10.0000.00717.37
8.1.00.0070.00017.46
8.0.300.0040.00419.88
8.0.290.0040.00416.63
8.0.280.0070.00018.37
8.0.270.0030.00417.32
8.0.260.0060.00017.18
8.0.250.0030.00316.86
8.0.240.0060.00317.00
8.0.230.0000.00816.84
8.0.220.0030.00316.80
8.0.210.0030.00316.90
8.0.200.0050.00516.88
8.0.190.0040.00416.95
8.0.180.0000.00916.91
8.0.170.0040.00416.88
8.0.160.0080.00016.83
8.0.150.0030.00316.80
8.0.140.0080.00016.77
8.0.130.0030.00313.22
8.0.120.0080.00016.92
8.0.110.0030.00516.93
8.0.100.0040.00416.86
8.0.90.0070.00016.80
8.0.80.0080.01216.91
8.0.70.0080.00016.77
8.0.60.0070.00016.82
8.0.50.0070.00016.93
8.0.30.0090.01016.97
8.0.20.0130.00617.40
8.0.10.0070.00016.89
8.0.00.0100.00716.76
7.4.330.0000.00515.55
7.4.320.0000.00616.60
7.4.300.0000.00716.53
7.4.290.0000.00716.41
7.4.280.0040.00416.64
7.4.270.0030.00316.50
7.4.260.0030.00316.59
7.4.250.0000.00716.48
7.4.240.0000.00716.43
7.4.230.0040.00416.52
7.4.220.0080.00016.49
7.4.210.0110.00816.58
7.4.200.0000.00716.42
7.4.160.0050.01116.47
7.4.140.0100.01017.86
7.4.130.0100.01016.55
7.4.120.0110.00816.52
7.4.110.0060.01216.32
7.4.100.0120.01216.42
7.4.90.0070.01416.61
7.4.80.0100.00719.39
7.4.70.0100.00616.38
7.4.60.0100.00616.44
7.4.50.0080.00816.21
7.4.40.0070.01516.44
7.4.00.0070.01014.83
7.3.330.0050.00013.23
7.3.320.0020.00213.26
7.3.310.0000.00716.15
7.3.300.0030.00316.28
7.3.290.0070.00016.34
7.3.280.0110.00616.28
7.3.260.0120.00716.46
7.3.240.0110.00716.50
7.3.230.0170.00316.43
7.3.210.0100.00716.45
7.3.200.0000.02116.38
7.3.190.0040.01216.57
7.3.180.0090.00916.47
7.3.170.0110.00616.41
7.3.160.0100.00616.62
7.3.10.0060.00616.35
7.3.00.0100.00716.33
7.2.330.0130.01016.67
7.2.320.0070.01016.47
7.2.310.0070.01016.46
7.2.300.0100.00716.82
7.2.290.0100.00816.75
7.2.130.0050.00816.46
7.2.120.0060.00616.68
7.2.110.0000.00916.66
7.2.100.0060.00316.76
7.2.90.0070.01016.52
7.2.80.0940.00715.74
7.2.70.0510.00916.03
7.2.60.0570.00515.95
7.2.50.1000.01215.99
7.2.40.0950.00915.92
7.2.30.1080.01015.98
7.2.20.0510.00915.70
7.2.10.0600.00616.05
7.2.00.0560.01015.92
7.1.250.0180.00615.61
7.1.200.0090.00615.90
7.1.190.1430.00613.84
7.1.180.1480.00713.94
7.1.170.1420.01014.00
7.1.160.1120.00713.98
7.1.150.1240.01213.94
7.1.140.1140.00713.93
7.1.130.1840.00714.14
7.1.120.1390.01313.83
7.1.110.1020.00314.16
7.1.100.0850.00913.91
7.1.90.2370.00313.76
7.1.80.1640.00713.41
7.1.70.2400.00713.38
7.1.60.1790.00731.88
7.1.50.2510.01331.69
7.1.40.3110.01031.91
7.1.30.2840.01031.77
7.1.20.2610.01031.46
7.1.10.2700.00713.45
7.1.00.1480.00314.08

preferences:
28.61 ms | 403 KiB | 5 Q