3v4l.org

run code in 300+ PHP versions simultaneously
<?php $response = '{"items": [{"id":"1","food":"rice","Amount":"100","condition":"paid"},\ {"id":"2","food":"beans","Amount":"200","condition":"paid"},\ {"id":"3","food":"yam","Amount":"50","condition":"not paid"},\ {"id":"4","food":"tomatoes","Amount":"100","condition":"paid"},\ {"id":"5","food":"potato","Amount":"700","condition":"paid"}]}'; $arr = json_decode(stripslashes($response), true); var_dump($arr); echo $arr['items'][1]['food']; // beans
Output for git.master, git.master_jit, rfc.property-hooks
array(1) { ["items"]=> array(5) { [0]=> array(4) { ["id"]=> string(1) "1" ["food"]=> string(4) "rice" ["Amount"]=> string(3) "100" ["condition"]=> string(4) "paid" } [1]=> array(4) { ["id"]=> string(1) "2" ["food"]=> string(5) "beans" ["Amount"]=> string(3) "200" ["condition"]=> string(4) "paid" } [2]=> array(4) { ["id"]=> string(1) "3" ["food"]=> string(3) "yam" ["Amount"]=> string(2) "50" ["condition"]=> string(8) "not paid" } [3]=> array(4) { ["id"]=> string(1) "4" ["food"]=> string(8) "tomatoes" ["Amount"]=> string(3) "100" ["condition"]=> string(4) "paid" } [4]=> array(4) { ["id"]=> string(1) "5" ["food"]=> string(6) "potato" ["Amount"]=> string(3) "700" ["condition"]=> string(4) "paid" } } } beans

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:
180.61 ms | 409 KiB | 5 Q