3v4l.org

run code in 300+ PHP versions simultaneously
<?php function array_to_xml($data, &$xml_data) { foreach ($data as $key => $value) { if (is_array($value)) { if (is_numeric($key)){ $key = 'item'.$key; //dealing with <0/>..<n/> issues } $subnode = $xml_data->addChild($key); array_to_xml($value, $subnode); } else { $xml_data->addChild("$key",htmlspecialchars("$value")); } } } $requestResult = <<<EOT { "name": "Benjamin Clementine", "mbid_id": "578e5d1c-be21-4158-b147-30aad67f207d", "albums": { "68e65535-f133-408d-93dd-205e9555eaa5": { "albumcover": [ { "id": "172070", "url": "http://assets.fanart.tv/fanart/music/578e5d1c-be21-4158-b147-30aad67f207d/albumcover/at-least-for-now-55b74dfa59411.jpg", "likes": "0" } ] } } } EOT; $decodedResult = json_decode($requestResult, true); $xmlELement = new SimpleXMLElement('<root/>'); array_to_xml($decodedResult, $xmlElement); print_r($xmlElement->xpath('//albumcover/url'));

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.60.0070.00716.63
8.3.50.0090.00618.29
8.3.40.0070.00719.04
8.3.30.0040.01118.79
8.3.20.0090.00020.42
8.3.10.0020.00523.86
8.3.00.0030.00519.63
8.2.180.0100.01316.88
8.2.170.0070.00722.96
8.2.160.0030.01020.62
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0000.01117.75
8.2.120.0080.00026.35
8.2.110.0030.00619.50
8.2.100.0000.01217.97
8.2.90.0040.00419.42
8.2.80.0000.00817.97
8.2.70.0040.00417.75
8.2.60.0030.00618.15
8.2.50.0000.00818.07
8.2.40.0000.00819.55
8.2.30.0040.00420.95
8.2.20.0000.00918.00
8.2.10.0000.00818.32
8.2.00.0000.00818.16
8.1.280.0120.00325.92
8.1.270.0080.00024.16
8.1.260.0080.00028.09
8.1.250.0030.00528.09
8.1.240.0090.00019.32
8.1.230.0080.00417.58
8.1.220.0060.00317.91
8.1.210.0030.00618.77
8.1.200.0030.00617.48
8.1.190.0040.00417.36
8.1.180.0030.00618.10
8.1.170.0040.00419.12
8.1.160.0000.00722.27
8.1.150.0040.00419.11
8.1.140.0050.00319.84
8.1.130.0000.00717.84
8.1.120.0070.00017.64
8.1.110.0050.00317.62
8.1.100.0000.00817.74
8.1.90.0050.00217.54
8.1.80.0040.00417.50
8.1.70.0070.00017.49
8.1.60.0080.00017.81
8.1.50.0040.00717.76
8.1.40.0000.00817.76
8.1.30.0000.00917.82
8.1.20.0030.00517.75
8.1.10.0070.00017.68
8.1.00.0050.00517.56
8.0.300.0000.00718.77
8.0.290.0030.00517.13
8.0.280.0030.00318.62
8.0.270.0040.00417.38
8.0.260.0000.00717.41
8.0.250.0000.00717.23
8.0.240.0040.00417.22
8.0.230.0000.00817.27
8.0.220.0000.00717.16
8.0.210.0050.00217.01
8.0.200.0030.00517.08
8.0.190.0080.00017.10
8.0.180.0000.00717.13
8.0.170.0060.00317.08
8.0.160.0000.00717.30
8.0.150.0040.00416.98
8.0.140.0040.00417.08
8.0.130.0000.00613.56
8.0.120.0040.00417.13
8.0.110.0000.00816.98
8.0.100.0040.00417.06
8.0.90.0070.00017.19
8.0.80.0000.01617.13
8.0.70.0030.00617.16
8.0.60.0040.00417.22
8.0.50.0050.00217.02
8.0.30.0090.01117.26
8.0.20.0090.01217.48
8.0.10.0040.00417.39
8.0.00.0110.00816.88
7.4.330.0000.00515.25
7.4.320.0000.00716.76
7.4.300.0060.00016.62
7.4.290.0030.00316.77
7.4.280.0040.00416.71
7.4.270.0070.00016.77
7.4.260.0050.00216.75
7.4.250.0040.00416.63
7.4.240.0000.00716.78
7.4.230.0030.00316.82
7.4.220.0060.01216.81
7.4.210.0100.00516.76
7.4.200.0050.00216.73
7.4.160.0090.00616.73
7.4.150.0140.00317.40
7.4.140.0120.00817.86
7.4.130.0070.01016.72
7.4.120.0140.00616.63
7.4.110.0060.01516.68
7.4.100.0070.01116.80
7.4.90.0100.01316.78
7.4.80.0100.00719.39
7.4.70.0150.00916.80
7.4.60.0070.01016.60
7.4.50.0040.00416.59
7.4.40.0090.01316.68
7.4.30.0150.00416.56
7.4.10.0000.01815.28
7.4.00.0120.00414.98
7.3.330.0000.00713.57
7.3.320.0030.00313.56
7.3.310.0040.00416.62
7.3.300.0000.00716.42
7.3.290.0070.00016.55
7.3.280.0060.01116.54
7.3.270.0120.00617.40
7.3.260.0100.00716.68
7.3.250.0160.00516.66
7.3.240.0060.01016.68
7.3.230.0080.01216.57
7.3.210.0080.00816.54
7.3.200.0120.00916.59
7.3.190.0120.00616.82
7.3.180.0090.00616.75
7.3.170.0180.00416.73
7.3.160.0100.00716.68
7.3.130.0140.00314.95
7.3.120.0070.01015.11
7.3.110.0070.00714.86
7.3.100.0080.00315.02
7.3.90.0060.00914.96
7.3.80.0080.00314.97
7.3.70.0070.00514.95
7.3.60.0020.00914.96
7.3.50.0050.00714.83
7.3.40.0080.00814.85
7.3.30.0050.00714.98
7.3.20.0050.01016.73
7.3.10.0050.00816.72
7.3.00.0030.00816.82
7.2.330.0110.01116.92
7.2.320.0120.01016.62
7.2.310.0070.01016.82
7.2.300.0070.01016.91
7.2.290.0060.01316.79
7.2.260.0060.01215.34
7.2.250.0050.01415.06
7.2.240.0100.00715.13
7.2.230.0020.01515.24
7.2.220.0090.00515.25
7.2.210.0090.00515.09
7.2.200.0050.00914.99
7.2.190.0050.00815.01
7.2.180.0070.00815.17
7.2.170.0080.00514.92
7.2.160.0030.01015.21
7.2.150.0040.01016.93
7.2.140.0060.00916.98
7.2.130.0060.00616.74
7.2.120.0030.01016.95
7.2.110.0120.00316.95
7.2.100.0090.00317.06
7.2.90.0080.00417.01
7.2.80.0090.00317.07
7.2.70.0090.00617.09
7.2.60.0030.01316.97
7.2.50.0000.01017.14
7.2.40.0100.00316.94
7.2.30.0150.00017.00
7.2.20.0040.01417.14
7.2.10.0000.01017.02
7.2.00.0070.00618.21
7.1.330.0040.01316.05
7.1.320.0000.01215.96
7.1.310.0020.00915.85
7.1.300.0070.00815.89
7.1.290.0030.01215.79
7.1.280.0080.00315.79
7.1.270.0080.00615.83
7.1.260.0040.00815.78
7.1.250.0000.01415.84
7.1.240.0070.00715.93
7.1.230.0090.00616.14
7.1.220.0000.01016.00
7.1.210.0070.00716.00
7.1.200.0100.00615.52
7.1.190.0060.00615.86
7.1.180.0060.00315.84
7.1.170.0040.00415.80
7.1.160.0000.01115.63
7.1.150.0060.01216.03
7.1.140.0070.01015.93
7.1.130.0000.00815.84
7.1.120.0040.00415.83
7.1.110.0130.00316.11
7.1.100.0070.00817.06
7.1.90.0030.00716.00
7.1.80.0090.00315.65
7.1.70.0080.00516.55
7.1.60.0120.01017.64
7.1.50.0120.00816.50
7.1.40.0030.00915.71
7.1.30.0000.01216.02
7.1.20.0040.00815.97
7.1.10.0030.01015.84
7.1.00.0020.04319.20
7.0.330.0040.01115.64
7.0.320.0040.00415.54
7.0.310.0110.00315.39
7.0.300.0000.01315.41
7.0.290.0030.00715.56
7.0.280.0070.01015.15
7.0.270.0090.00615.51
7.0.260.0070.01015.35
7.0.250.0110.00315.58
7.0.240.0000.01215.61
7.0.230.0080.00615.53
7.0.220.0060.00615.58
7.0.210.0070.00715.57
7.0.200.0030.00915.17
7.0.190.0060.00615.63
7.0.180.0060.00615.40
7.0.170.0030.01015.57
7.0.160.0000.01415.33
7.0.150.0030.01015.59
7.0.140.0070.00715.57
7.0.130.0000.01215.31
7.0.120.0070.00715.64
7.0.110.0060.00915.48
7.0.100.0060.00615.53
7.0.90.0030.00515.39
7.0.80.0070.00715.59
7.0.70.0030.00815.34
7.0.60.0060.03817.88
7.0.50.0040.02316.71
7.0.40.0080.02216.82
7.0.30.0180.04217.02
7.0.20.0070.03116.99
7.0.10.0040.03817.01
7.0.00.0090.02216.97
5.6.400.0030.01514.02
5.6.390.0040.01114.68
5.6.380.0030.00814.70
5.6.370.0000.01214.18
5.6.360.0030.00614.47
5.6.350.0070.00714.40
5.6.340.0060.00314.39
5.6.330.0100.00314.59
5.6.320.0030.01314.29
5.6.310.0060.00314.24
5.6.300.0040.01114.53
5.6.290.0000.01114.24
5.6.280.0050.02217.63
5.6.270.0030.01414.45
5.6.260.0060.00314.20
5.6.250.0060.00914.43
5.6.240.0030.00714.30
5.6.230.0040.01114.28
5.6.220.0060.00614.73
5.6.210.0040.04617.52
5.6.200.0100.04016.37
5.6.190.0030.03417.63
5.6.180.0220.04117.63
5.6.170.0220.03417.49
5.6.160.0070.02817.40
5.6.150.0080.02916.31
5.6.140.0070.04516.33
5.6.130.0030.05116.20
5.6.120.0100.04217.81
5.6.110.0070.04617.78
5.6.100.0030.02517.81
5.6.90.0020.02617.71
5.6.80.0140.03117.48
5.6.70.0070.01014.55
5.6.60.0030.01314.27
5.6.50.0080.00814.15
5.6.40.0070.01314.15
5.6.30.0030.00614.33
5.6.20.0110.00014.67
5.6.10.0030.01314.56
5.6.00.0030.01014.26
5.5.380.0100.00314.72
5.5.370.0070.01014.34
5.5.360.0050.00314.26
5.5.350.2130.02517.42
5.5.340.0090.02516.03
5.5.330.0090.04017.34
5.5.320.0050.02917.43
5.5.310.0090.02117.44
5.5.300.0070.04516.07
5.5.290.0080.02216.11
5.5.280.0120.04217.73
5.5.270.0080.03417.76
5.5.260.0120.04017.60
5.5.250.0070.03817.51
5.5.240.0060.03817.21
5.5.230.0060.00614.18
5.5.220.0070.00314.34
5.5.210.0070.00714.21
5.5.200.0070.01314.35
5.5.190.0070.00714.45
5.5.180.0090.00314.50
5.5.170.0030.01314.01
5.5.160.0040.01413.91
5.5.150.0000.01514.37
5.5.140.0140.00014.41
5.5.130.0070.01114.36
5.5.120.0090.00914.07
5.5.110.0060.00614.38
5.5.100.0030.00913.99
5.5.90.0000.01014.09
5.5.80.0070.00714.01
5.5.70.0110.00414.07
5.5.60.0030.01014.35
5.5.50.0070.00714.10
5.5.40.0110.00314.25
5.5.30.0040.01214.18
5.5.20.0120.00014.31
5.5.10.0000.00913.93
5.5.00.0060.00914.01

preferences:
50.4 ms | 400 KiB | 5 Q