3v4l.org

run code in 300+ PHP versions simultaneously
<?php $jsonStr = '{"return_data": { "friend_info": [ { "desc": "name", "value": "Ken" }, { "desc": "profile_pic", "value": "http://aaa.caa/1234569/picture?type=large" } ] }}'; $json = json_decode($jsonStr, true); $obj = new stdClass; foreach ($json["return_data"]["friend_info"] as $item) $obj->{$item["desc"]} = $item["value"]; $json["return_data"]["friend_info"] = $obj; $jsonStr = json_encode($json); echo $jsonStr;
Output for git.master, git.master_jit, rfc.property-hooks
{"return_data":{"friend_info":{"name":"Ken","profile_pic":"http:\/\/aaa.caa\/1234569\/picture?type=large"}}}

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:
22.82 ms | 401 KiB | 8 Q