3v4l.org

run code in 300+ PHP versions simultaneously
<?php $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_walk_recursive($decodedResult, array($xmlElement, 'addChild')); print_r($xmlElement->xpath('//albumcover/url'));
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $xmlElement in /in/7lWp3 on line 24 Fatal error: Uncaught TypeError: array_walk_recursive(): Argument #2 ($callback) must be a valid callback, first array member is not a valid class name or object in /in/7lWp3:24 Stack trace: #0 /in/7lWp3(24): array_walk_recursive(Array, Array) #1 {main} thrown in /in/7lWp3 on line 24
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
60.32 ms | 401 KiB | 8 Q