3v4l.org

run code in 500+ PHP versions simultaneously
<?php $result = json_decode('[ { "id": "GRP-25", "text": "All Areas", "groupid": 0, "leaf": false, "qtip": "Common", "link": null, "helplink": null, "children": [ { "id": "GRP-25", "text": "All Areas", "groupid": 0, "leaf": true, "qtip": "Common", "link": null, "helplink": null } ] }, { "id": "GRP-25", "text": "All Areas", "groupid": 0, "leaf": false, "qtip": "Common", "link": null, "helplink": null } ]', true); function changeLeafId(array &$data) { foreach ($data as $k => $v) { // recursive call if (is_array($v)) { changeLeafId($data[$k]); continue; } // update 'id' from 'leaf' if ($k == 'id' && $data['leaf'] ?? false) { $data[$k] = 'GRP-' . $v; } } } changeLeafId($result); print_r($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.60.0040.00516.76
8.5.50.0130.00416.81
8.5.30.0080.00820.14
8.5.20.0060.00221.80
8.5.10.0110.00718.82
8.5.00.0140.00819.82
8.4.210.0110.00621.31
8.4.180.0130.00819.70
8.4.170.0150.00723.79
8.4.160.0140.00923.10
8.4.150.0080.00416.91
8.4.140.0110.00417.52
8.4.130.0110.00917.50
8.4.120.0120.00820.62
8.4.110.0100.00922.48
8.4.100.0050.00317.61
8.4.90.0130.00720.41
8.4.80.0060.00224.15
8.4.70.0110.00618.66
8.4.60.0110.01020.57
8.4.50.0060.00418.66
8.4.40.0130.00717.60
8.4.30.0060.00920.38
8.4.20.0100.00018.07
8.4.10.0060.01317.74
8.3.300.0150.00720.63
8.3.290.0160.00420.82
8.3.280.0140.00718.32
8.3.270.0130.00916.64
8.3.260.0080.01216.53
8.3.250.0120.00718.88
8.3.240.0100.01016.60
8.3.230.0090.01016.36
8.3.220.0110.00719.00
8.3.210.0100.00816.71
8.3.200.0050.00316.61
8.3.190.0070.00617.26
8.3.180.0150.00518.81
8.3.170.0110.00717.28
8.3.160.0110.00716.56
8.3.150.0040.00417.32
8.3.140.0040.00416.95
8.3.130.0050.00218.52
8.3.120.0040.00418.94
8.3.110.0060.00316.63
8.3.100.0120.00424.06
8.3.90.0060.00326.77
8.3.80.0080.00416.48
8.3.70.0110.01118.43
8.3.60.0090.00618.56
8.3.50.0130.00320.18
8.3.40.0100.00320.43
8.3.30.0130.00919.11
8.3.20.0000.00724.18
8.3.10.0080.00024.66
8.3.00.0000.00826.16
8.2.300.0090.01117.94
8.2.290.0070.00117.37
8.2.280.0110.00718.21
8.2.270.0070.01116.70
8.2.260.0030.00517.16
8.2.250.0080.00016.49
8.2.240.0040.00717.39
8.2.230.0030.01320.94
8.2.220.0080.00037.54
8.2.210.0090.00926.77
8.2.200.0130.00016.50
8.2.190.0200.00016.58
8.2.180.0070.00725.92
8.2.170.0110.00419.09
8.2.160.0090.00622.96
8.2.150.0040.00425.66
8.2.140.0080.00024.66
8.2.130.0060.00326.16
8.2.120.0030.00521.03
8.2.110.0040.00720.90
8.2.100.0060.00617.97
8.2.90.0030.00517.75
8.2.80.0060.00318.91
8.2.70.0040.00417.75
8.2.60.0000.00817.50
8.2.50.0050.00317.55
8.2.40.0030.00618.34
8.2.30.0080.00018.17
8.2.20.0030.00620.48
8.2.10.0080.00017.62
8.2.00.0040.00419.18
8.1.340.0070.01317.54
8.1.330.0120.00716.27
8.1.320.0110.00816.05
8.1.310.0130.00316.86
8.1.300.0060.00318.01
8.1.290.0070.00318.88
8.1.280.0000.02125.92
8.1.270.0040.00423.99
8.1.260.0060.01026.35
8.1.250.0070.00028.09
8.1.240.0000.01019.13
8.1.230.0060.00620.92
8.1.220.0040.00418.60
8.1.210.0000.00818.77
8.1.200.0030.00717.35
8.1.190.0080.00017.35
8.1.180.0000.00818.10
8.1.170.0050.00318.51
8.1.160.0050.00318.85
8.1.150.0030.00618.68
8.1.140.0040.00417.45
8.1.130.0000.00719.23
8.1.120.0030.00417.45
8.1.110.0070.00017.46
8.1.100.0040.00417.38
8.1.90.0040.00417.36
8.1.80.0000.00817.45
8.1.70.0000.01017.35
8.1.60.0000.00717.46
8.1.50.0040.00417.50
8.1.40.0000.00817.48
8.1.30.0050.00317.71
8.1.20.0140.00817.70
8.1.10.0220.00617.50
8.1.00.0230.00417.39
8.0.300.0040.00420.02
8.0.290.0050.00316.75
8.0.280.0000.01118.32
8.0.270.0030.00518.12
8.0.260.0030.00318.58
8.0.250.0040.00417.03
8.0.240.0040.00416.98
8.0.230.0000.00716.90
8.0.220.0000.00716.96
8.0.210.0070.00016.88
8.0.200.0000.00716.97
8.0.190.0040.00416.91
8.0.180.0000.00716.98
8.0.170.0000.00816.95
8.0.160.0130.00916.81
8.0.150.0190.00316.94
8.0.140.0170.00616.95
8.0.130.0160.00416.86
8.0.120.0180.00416.80
8.0.110.0150.00616.91
8.0.100.0160.00516.73
8.0.90.0130.00416.86
8.0.80.0170.00416.72
8.0.70.0210.00416.76
8.0.60.0190.00516.89
8.0.50.0130.00316.73
8.0.30.0110.00616.94
8.0.20.0140.00517.03
8.0.10.0180.00317.02
7.4.330.0030.00315.55
7.4.320.0000.00616.49
7.4.300.0000.00616.62
7.4.290.0080.00016.64
7.4.280.0210.00316.50
7.4.270.0190.00416.50
7.4.260.0150.00716.47
7.4.250.0190.00316.57
7.4.240.0140.00516.59
7.4.230.0070.00516.55
7.4.220.0120.00216.52
7.4.210.0120.00616.53
7.4.200.0040.00916.29
7.4.190.0140.00416.43
7.4.180.0130.00316.54
7.4.160.0110.00016.54
7.4.150.0110.00416.43
7.4.140.0180.00316.36
7.4.130.0130.00016.56
7.4.120.0200.00016.46
7.4.110.0140.00716.44
7.4.100.0170.00416.50
7.4.90.0170.00316.43
7.4.80.0100.00716.27
7.4.70.0090.00516.27
7.4.60.0040.00816.53
7.4.50.0160.00416.38
7.4.40.0120.00916.38
7.4.30.0160.00516.29
7.4.20.0100.01016.44
7.4.10.0170.00016.44
7.4.00.0060.00916.22

preferences:
36.62 ms | 1423 KiB | 5 Q