3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = <<<'EOL' { "syndicate-to": [ { "uid": "https://myfavoritesocialnetwork.example/aaronpk", "name": "aaronpk on myfavoritesocialnetwork", "service": { "name": "My Favorite Social Network", "url": "https://myfavoritesocialnetwork.example/", "photo": "https://myfavoritesocialnetwork.example/img/icon.png" }, "user": { "name": "aaronpk", "url": "https://myfavoritesocialnetwork.example/aaronpk", "photo": "https://myfavoritesocialnetwork.example/aaronpk/photo.jpg" } } ] } EOL; $data = json_decode($json, true); var_dump($data); var_dump(json_last_error()); var_dump($data['syndicate-to'][0]['uid']);
Output for git.master, git.master_jit, rfc.property-hooks
array(1) { ["syndicate-to"]=> array(1) { [0]=> array(4) { ["uid"]=> string(47) "https://myfavoritesocialnetwork.example/aaronpk" ["name"]=> string(34) "aaronpk on myfavoritesocialnetwork" ["service"]=> array(3) { ["name"]=> string(26) "My Favorite Social Network" ["url"]=> string(40) "https://myfavoritesocialnetwork.example/" ["photo"]=> string(52) "https://myfavoritesocialnetwork.example/img/icon.png" } ["user"]=> array(3) { ["name"]=> string(7) "aaronpk" ["url"]=> string(47) "https://myfavoritesocialnetwork.example/aaronpk" ["photo"]=> string(57) "https://myfavoritesocialnetwork.example/aaronpk/photo.jpg" } } } } int(0) string(47) "https://myfavoritesocialnetwork.example/aaronpk"

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:
52.04 ms | 403 KiB | 8 Q