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); var_dump($data); var_dump(json_last_error()); var_dump($data->syndicate-to);
Output for git.master, git.master_jit, rfc.property-hooks
object(stdClass)#4 (1) { ["syndicate-to"]=> array(1) { [0]=> object(stdClass)#1 (4) { ["uid"]=> string(47) "https://myfavoritesocialnetwork.example/aaronpk" ["name"]=> string(34) "aaronpk on myfavoritesocialnetwork" ["service"]=> object(stdClass)#2 (3) { ["name"]=> string(26) "My Favorite Social Network" ["url"]=> string(40) "https://myfavoritesocialnetwork.example/" ["photo"]=> string(52) "https://myfavoritesocialnetwork.example/img/icon.png" } ["user"]=> object(stdClass)#3 (3) { ["name"]=> string(7) "aaronpk" ["url"]=> string(47) "https://myfavoritesocialnetwork.example/aaronpk" ["photo"]=> string(57) "https://myfavoritesocialnetwork.example/aaronpk/photo.jpg" } } } } int(0) Warning: Undefined property: stdClass::$syndicate in /in/3akiR on line 27 Fatal error: Uncaught Error: Undefined constant "to" in /in/3akiR:27 Stack trace: #0 {main} thrown in /in/3akiR on line 27
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:
57.74 ms | 402 KiB | 8 Q