3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $json ='{ "response": { "result": "OK", "params": { "orderid": 144552513557, "transid": 737821904945243852, "steamid": 76561197972214334, "status": "Succeeded", "currency": "EUR", "time": "2015-10-22T14:46:34Z", "country": "DE", "usstate": "", "timecreated": "2015-10-22T14:46:10Z", "items": [ { "itemid": 3, "qty": 1, "amount": 2521, "vat": 479, "itemstatus": "Succeeded" } ] } } }'; var_dump(json_decode($json)); var_dump(json_decode($json, true, 512)); ?>
based on tYH9r
Output for 7.0.0 - 7.2.0
object(stdClass)#4 (1) { ["response"]=> object(stdClass)#1 (2) { ["result"]=> string(2) "OK" ["params"]=> object(stdClass)#2 (10) { ["orderid"]=> int(144552513557) ["transid"]=> int(737821904945243852) ["steamid"]=> int(76561197972214334) ["status"]=> string(9) "Succeeded" ["currency"]=> string(3) "EUR" ["time"]=> string(20) "2015-10-22T14:46:34Z" ["country"]=> string(2) "DE" ["usstate"]=> string(0) "" ["timecreated"]=> string(20) "2015-10-22T14:46:10Z" ["items"]=> array(1) { [0]=> object(stdClass)#3 (5) { ["itemid"]=> int(3) ["qty"]=> int(1) ["amount"]=> int(2521) ["vat"]=> int(479) ["itemstatus"]=> string(9) "Succeeded" } } } } } array(1) { ["response"]=> array(2) { ["result"]=> string(2) "OK" ["params"]=> array(10) { ["orderid"]=> int(144552513557) ["transid"]=> int(737821904945243852) ["steamid"]=> int(76561197972214334) ["status"]=> string(9) "Succeeded" ["currency"]=> string(3) "EUR" ["time"]=> string(20) "2015-10-22T14:46:34Z" ["country"]=> string(2) "DE" ["usstate"]=> string(0) "" ["timecreated"]=> string(20) "2015-10-22T14:46:10Z" ["items"]=> array(1) { [0]=> array(5) { ["itemid"]=> int(3) ["qty"]=> int(1) ["amount"]=> int(2521) ["vat"]=> int(479) ["itemstatus"]=> string(9) "Succeeded" } } } } }
Output for 5.3.19 - 5.6.28
object(stdClass)#1 (1) { ["response"]=> object(stdClass)#2 (2) { ["result"]=> string(2) "OK" ["params"]=> object(stdClass)#3 (10) { ["orderid"]=> int(144552513557) ["transid"]=> int(737821904945243852) ["steamid"]=> int(76561197972214334) ["status"]=> string(9) "Succeeded" ["currency"]=> string(3) "EUR" ["time"]=> string(20) "2015-10-22T14:46:34Z" ["country"]=> string(2) "DE" ["usstate"]=> string(0) "" ["timecreated"]=> string(20) "2015-10-22T14:46:10Z" ["items"]=> array(1) { [0]=> object(stdClass)#4 (5) { ["itemid"]=> int(3) ["qty"]=> int(1) ["amount"]=> int(2521) ["vat"]=> int(479) ["itemstatus"]=> string(9) "Succeeded" } } } } } array(1) { ["response"]=> array(2) { ["result"]=> string(2) "OK" ["params"]=> array(10) { ["orderid"]=> int(144552513557) ["transid"]=> int(737821904945243852) ["steamid"]=> int(76561197972214334) ["status"]=> string(9) "Succeeded" ["currency"]=> string(3) "EUR" ["time"]=> string(20) "2015-10-22T14:46:34Z" ["country"]=> string(2) "DE" ["usstate"]=> string(0) "" ["timecreated"]=> string(20) "2015-10-22T14:46:10Z" ["items"]=> array(1) { [0]=> array(5) { ["itemid"]=> int(3) ["qty"]=> int(1) ["amount"]=> int(2521) ["vat"]=> int(479) ["itemstatus"]=> string(9) "Succeeded" } } } } }