3v4l.org

run code in 300+ PHP versions simultaneously
<?php $jsons[] = <<<JSON { "success": true, "msg": "", "obj": [ { "id": 1, "remark": "D" }, { "id": 159, "remark": "mssdss" } ] } JSON; $jsons[] = <<<JSON { "success": true, "msg": "", "obj": [ { "id": 14, "remark": "tttt" }, { "id": 56, "remark": "ok" } ] } JSON; $result = null; foreach ($jsons as $json) { $obj = json_decode($json); if (!$obj->success) { throw new Exception($obj->msg); } if (!$result) { $result = $obj; } else { array_push($result->obj, ...$obj->obj); } } var_export($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.5.30.0100.00719.46
8.5.20.0060.00418.59
8.5.10.0110.00716.63
8.5.00.0110.01120.07
8.4.180.0100.01219.77
8.4.170.0110.01021.88
8.4.160.0110.00922.24
8.4.150.0070.00516.92
8.4.140.0160.00517.65
8.4.130.0110.01017.84
8.4.120.0040.00622.31
8.4.110.0110.01022.22
8.4.100.0110.00817.97
8.4.90.0060.00318.87
8.4.80.0100.00919.38
8.4.70.0120.00817.96
8.4.60.0050.01123.98
8.4.50.0060.00218.39
8.4.40.0130.00717.53
8.4.30.0070.01422.34
8.4.20.0100.01017.64
8.4.10.0040.00419.39
8.3.300.0100.01218.33
8.3.290.0110.01020.82
8.3.280.0110.00920.72
8.3.270.0140.00516.48
8.3.260.0110.00916.56
8.3.250.0050.00419.12
8.3.240.0090.01116.69
8.3.230.0130.00616.53
8.3.220.0090.01017.25
8.3.210.0090.00518.43
8.3.200.0060.00316.78
8.3.190.0130.00617.18
8.3.180.0080.00216.17
8.3.170.0090.00917.06
8.3.160.0090.00916.73
8.3.150.0060.01216.53
8.3.140.0080.00017.20
8.3.130.0030.00618.50
8.3.120.0060.00319.17
8.3.110.0050.00320.94
8.3.100.0000.00924.06
8.3.90.0040.00426.77
8.3.80.0030.00618.43
8.3.70.0140.00416.75
8.3.60.0040.01118.40
8.3.50.0170.00316.58
8.3.40.0030.01221.86
8.3.30.0070.00719.09
8.3.20.0090.00024.18
8.3.10.0070.00024.66
8.3.00.0040.00426.16
8.2.300.0120.00920.38
8.2.290.0080.00920.56
8.2.280.0080.01218.38
8.2.270.0130.00616.49
8.2.260.0090.00916.38
8.2.250.0030.00516.66
8.2.240.0150.00318.65
8.2.230.0050.00322.58
8.2.220.0000.01037.54
8.2.210.0040.00426.77
8.2.200.0060.00316.50
8.2.190.0190.00316.62
8.2.180.0030.01016.63
8.2.170.0120.00318.69
8.2.160.0090.00922.96
8.2.150.0060.00325.66
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0070.00021.18
8.2.110.0090.00019.38
8.2.100.0270.00017.57
8.2.90.0240.00717.42
8.2.80.0320.00017.42
8.2.70.0250.00517.42
8.2.60.0250.00417.42
8.2.50.0250.00617.42
8.2.40.0240.00317.42
8.2.30.0180.00717.42
8.2.20.0000.01417.50
8.2.10.0170.01117.50
8.2.00.0200.00617.50
8.1.340.0150.00620.06
8.1.330.0090.00823.93
8.1.320.0080.01015.94
8.1.310.0070.01116.22
8.1.300.0100.00618.39
8.1.290.0040.00430.84
8.1.280.0070.01425.92
8.1.270.0110.00424.66
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0030.00623.91
8.1.230.0060.00617.89
8.1.220.0150.01217.42
8.1.210.0260.00017.42
8.1.200.0250.00417.42
8.1.190.0190.00917.42
8.1.180.0220.00617.42
8.1.170.0150.01117.42
8.1.160.0240.00217.42
8.1.150.0230.00617.42
8.1.140.0300.00017.42
8.1.130.0190.00817.42
8.1.120.0210.00817.42
8.1.110.0220.00617.42
8.1.100.0260.00017.42
8.1.90.0220.00417.42
8.1.80.0210.00817.42
8.1.70.0180.01017.42
8.1.60.0160.00817.42
8.1.50.0230.00617.50
8.1.40.0250.00317.42
8.1.30.0300.00017.42
8.1.20.0270.00017.42
8.1.10.0170.00817.42
8.1.00.0230.00317.42
8.0.300.0250.00317.42
8.0.290.0280.00017.42
8.0.280.0150.01517.42
8.0.270.0200.00917.42
8.0.260.0240.00317.42
8.0.250.0160.01217.42
8.0.240.0200.00917.42
8.0.230.0200.00617.42
8.0.220.0120.01617.42
8.0.210.0170.01017.42
8.0.200.0200.00717.42
8.0.190.0240.00417.42
8.0.180.0170.01017.42
8.0.170.0290.00017.42
8.0.160.0250.00417.42
8.0.150.0220.00917.42
8.0.140.0200.01117.42
8.0.130.0270.00517.42
8.0.120.0260.00017.42
8.0.110.0260.00017.42
8.0.100.0260.00317.42
8.0.90.0230.00617.42
8.0.80.0210.00917.42
8.0.70.0300.00017.42
8.0.60.0180.00917.42
8.0.50.0250.00017.42
8.0.30.0200.00417.42
8.0.20.0190.01017.42
8.0.10.0260.00317.42

preferences:
52.32 ms | 1169 KiB | 5 Q