3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = json_decode('[ { "products": [ { "Part ID" : "001", "name" : "Product Name", "category" : "Product Category", "description" : "Product Description", "id" : "111xyz" }, { "Part ID" : "002", "name" : "Product Name 2", "category" : "Product Category 2", "description" : "Product Description 2", "id" : "333xyz" }, { "Part ID" : "003", "name" : "Product Name 3", "category" : "Product Category 3", "description" : "Product Description 3", "id" : "444xyz" }, { "Part ID" : "004", "name" : "Product Name 4", "category" : "Product Category", "description" : "Product Description", "id" : "666xyz", "features_img_id":["f1","f2","f3"] }] }, { "assets": [ { "File Name" : "Some file name", "url" : "www.123.com/x.jpg", "id" : "111xyz" }, { "File Name" : "Feature 1 file", "url" : "www.123.com/f1.jpg", "id" : "f1" }, { "File Name" : "Feature 2 file", "url" : "www.123.com/f2.jpg", "id" : "f2" }, { "File Name" : "Feature 2 file", "url" : "www.123.com/f3.jpg", "id" : "f3" }] } ]'); $map = array_column($array[1]->assets, 'url', 'id'); foreach ($array[0]->products as $obj) { if (isset($map[$obj->id])) { $obj->url = $map[$obj->id]; } foreach ($obj->features_img_id ?? [] as $imgId) { if (isset($map[$imgId])) { $obj->feature_img_url[] = $map[$imgId]; } } unset($obj->id, $obj->features_img_id); } var_export($array[0]->products);

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.00721.07
8.5.20.0100.00719.50
8.5.10.0070.01019.98
8.5.00.0090.01219.98
8.4.180.0110.01219.58
8.4.170.0100.01320.54
8.4.160.0130.01121.52
8.4.150.0060.00617.83
8.4.140.0130.00917.59
8.4.130.0070.00517.83
8.4.120.0110.00723.72
8.4.110.0100.01018.77
8.4.100.0110.00617.54
8.4.90.0130.00718.96
8.4.80.0110.00920.54
8.4.70.0090.00717.95
8.4.60.0110.00819.03
8.4.50.0100.01018.76
8.4.40.0090.00017.70
8.4.30.0070.01120.83
8.4.20.0040.01617.82
8.4.10.0160.00323.83
8.3.300.0110.01018.43
8.3.290.0100.00920.66
8.3.280.0130.00718.40
8.3.270.0130.00716.80
8.3.260.0040.00416.68
8.3.250.0100.00819.16
8.3.240.0100.00917.04
8.3.230.0110.00916.66
8.3.220.0060.00218.89
8.3.210.0120.00716.69
8.3.200.0040.00516.80
8.3.190.0100.00719.05
8.3.180.0130.00517.20
8.3.170.0130.00620.80
8.3.160.0090.00918.34
8.3.150.0090.00917.18
8.3.140.0160.00316.53
8.3.130.0080.00018.34
8.3.120.0090.00018.87
8.3.110.0040.00418.43
8.3.100.0070.00324.06
8.3.90.0060.01226.77
8.3.80.0040.01118.55
8.3.70.0090.00616.63
8.3.60.0120.00316.75
8.3.50.0080.00820.34
8.3.40.0110.00422.10
8.3.30.0070.00718.67
8.3.20.0000.00924.18
8.3.10.0050.00224.66
8.3.00.0040.00426.16
8.2.300.0150.00522.11
8.2.290.0100.00720.51
8.2.280.0090.01118.55
8.2.270.0070.01117.15
8.2.260.0090.00616.51
8.2.250.0050.00316.63
8.2.240.0090.00017.27
8.2.230.0000.01020.94
8.2.220.0060.00337.54
8.2.210.0110.00726.77
8.2.200.0110.00016.75
8.2.190.0120.00618.24
8.2.180.0160.00325.92
8.2.170.0140.00418.92
8.2.160.0070.00722.96
8.2.150.0000.00825.66
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0040.00426.16
8.2.110.0100.00020.87
8.2.100.0120.00017.91
8.2.90.0000.00817.84
8.2.80.0000.00819.15
8.2.70.0050.00317.63
8.2.60.0030.00617.63
8.2.50.0040.00418.05
8.2.40.0060.00319.95
8.2.30.0040.00418.11
8.2.20.0040.00419.19
8.2.10.0000.00718.12
8.2.00.0000.00819.32
8.1.340.0150.00717.59
8.1.330.0110.00821.92
8.1.320.0110.00918.05
8.1.310.0110.00318.15
8.1.300.0030.01220.33
8.1.290.0090.00030.84
8.1.280.0130.01025.92
8.1.270.0000.00722.06
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0000.00922.54
8.1.230.0120.00020.93
8.1.220.0000.00917.76
8.1.210.0050.00318.79
8.1.200.0000.00817.47
8.1.190.0040.00417.35
8.1.180.0060.00318.10
8.1.170.0000.00818.50
8.1.160.0020.00518.93
8.1.150.0040.00418.65
8.1.140.0050.00217.37
8.1.130.0000.00718.89
8.1.120.0070.00017.50
8.1.110.0120.00017.45
8.1.100.0070.00417.30
8.1.90.0100.00517.46
8.1.80.0130.00317.35
8.1.70.0140.00017.29
8.1.60.0110.00017.27
8.1.50.0090.00617.45
8.1.40.0030.00917.17
8.1.30.0100.00517.57
8.1.20.0070.00717.68
8.1.10.0100.00317.58
8.1.00.0080.00817.47
8.0.300.0000.00720.21
8.0.290.0000.00716.75
8.0.280.0000.00718.33
8.0.270.0030.00317.18
8.0.260.0070.00018.31
8.0.250.0060.00016.93
8.0.240.0050.00516.76
8.0.230.0120.00316.93
8.0.220.0070.00716.86
8.0.210.0060.00716.83
8.0.200.0100.00316.98
8.0.190.0110.00416.98
8.0.180.0080.00816.98
8.0.170.0150.00016.81
8.0.160.0150.00016.91
8.0.150.0140.00016.75
8.0.140.0120.00316.74
8.0.130.0110.00516.84
8.0.120.0140.00316.71
8.0.110.0130.00316.93
8.0.100.0090.00616.88
8.0.90.0120.00216.80
8.0.80.0040.00916.89
8.0.70.0000.01316.76
8.0.60.0060.00616.88
8.0.50.0100.00316.79
8.0.30.0110.00416.66
8.0.20.0140.00016.95
8.0.10.0090.00616.88
7.4.330.0000.00515.55
7.4.320.0100.00716.37
7.4.300.0080.00816.41
7.4.290.0120.00316.59
7.4.280.0130.00316.61
7.4.270.0160.00016.57
7.4.260.0150.00316.60
7.4.250.0130.00516.48
7.4.240.0170.00016.59
7.4.230.0160.00016.64
7.4.220.0100.00516.41
7.4.210.0100.00316.45
7.4.200.0040.00916.52
7.4.190.0100.00016.21
7.4.180.0050.00516.20
7.4.160.0040.00816.58
7.4.150.0070.00316.39
7.4.140.0020.00716.36
7.4.130.0050.00916.55
7.4.120.0150.00016.37
7.4.110.0100.00516.37
7.4.100.0090.00616.43
7.4.90.0110.00516.43
7.4.80.0110.00416.45
7.4.70.0150.00016.55
7.4.60.0130.00316.52
7.4.50.0110.00416.36
7.4.40.0070.00516.43
7.4.30.0020.00816.27
7.4.20.0110.00016.18
7.4.10.0000.01016.16
7.4.00.0000.01216.27

preferences:
45.21 ms | 1409 KiB | 5 Q