3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $string = '[{ "errorcode": "0", "xml": { "seat-map": { "lower-deck": { "column": [ { "$": { "id": "1" }, "row": [ { "$": { "id": "1" }, "seat": { "$": { "number": "3", "status": "0" } } }, { "$": { "id": "2" }, "seat": { "$": { "number": "6", "status": "0" } } }, { "$": { "id": "3" }, "seat": { "$": { "number": "9", "status": "0" } } }, { "$": { "id": "4" }, "seat": { "$": { "number": "12", "status": "0" } } }, { "$": { "id": "5" }, "seat": { "$": { "number": "15", "status": "0" } } }, { "$": { "id": "6" }, "seat": { "$": { "number": "18", "status": "0" } } }, { "$": { "id": "7" }, "seat": { "$": { "number": "21", "status": "0" } } }, { "$": { "id": "8" }, "seat": { "$": { "number": "24", "status": "0" } } }, { "$": { "id": "9" }, "seat": { "$": { "number": "27", "status": "0" } } }, { "$": { "id": "10" }, "seat": { "$": { "number": "#", "status": "blank" } } }, { "$": { "id": "11" }, "seat": { "$": { "number": "#", "status": "blank" } } }, { "$": { "id": "12" }, "seat": { "$": { "number": "#", "status": "blank" } } } ] }, { "$": { "id": "2" }, "row": [ { "$": { "id": "1" }, "seat": { "$": { "number": "2", "status": "0" } } }, { "$": { "id": "2" }, "seat": { "$": { "number": "5", "status": "0" } } }, { "$": { "id": "3" }, "seat": { "$": { "number": "8", "status": "0" } } }, { "$": { "id": "4" }, "seat": { "$": { "number": "11", "status": "0" } } }, { "$": { "id": "5" }, "seat": { "$": { "number": "14", "status": "0" } } }, { "$": { "id": "6" }, "seat": { "$": { "number": "17", "status": "0" } } }, { "$": { "id": "7" }, "seat": { "$": { "number": "20", "status": "0" } } }, { "$": { "id": "8" }, "seat": { "$": { "number": "23", "status": "0" } } }, { "$": { "id": "9" }, "seat": { "$": { "number": "26", "status": "0" } } }, { "$": { "id": "10" }, "seat": { "$": { "number": "#", "status": "blank" } } }, { "$": { "id": "11" }, "seat": { "$": { "number": "#", "status": "blank" } } }, { "$": { "id": "12" }, "seat": { "$": { "number": "#", "status": "blank" } } } ] }, { "$": { "id": "3" }, "row": [ { "$": { "id": "1" }, "seat": { "$": { "number": "#", "status": "blank" } } }, { "$": { "id": "2" }, "seat": { "$": { "number": "#", "status": "blank" } } }, { "$": { "id": "3" }, "seat": { "$": { "number": "#", "status": "blank" } } }, { "$": { "id": "4" }, "seat": { "$": { "number": "#", "status": "blank" } } }, { "$": { "id": "5" }, "seat": { "$": { "number": "#", "status": "blank" } } }, { "$": { "id": "6" }, "seat": { "$": { "number": "#", "status": "blank" } } }, { "$": { "id": "7" }, "seat": { "$": { "number": "#", "status": "blank" } } }, { "$": { "id": "8" }, "seat": { "$": { "number": "#", "status": "blank" } } }, { "$": { "id": "9" }, "seat": { "$": { "number": "#", "status": "blank" } } }, { "$": { "id": "10" }, "seat": { "$": { "number": "#", "status": "blank" } } }, { "$": { "id": "11" }, "seat": { "$": { "number": "#", "status": "blank" } } }, { "$": { "id": "12" }, "seat": { "$": { "number": "#", "status": "blank" } } } ] }, { "$": { "id": "4" }, "row": [ { "$": { "id": "1" }, "seat": { "$": { "number": "1", "status": "0" } } }, { "$": { "id": "2" }, "seat": { "$": { "number": "4", "status": "0" } } }, { "$": { "id": "3" }, "seat": { "$": { "number": "7", "status": "0" } } }, { "$": { "id": "4" }, "seat": { "$": { "number": "10", "status": "0" } } }, { "$": { "id": "5" }, "seat": { "$": { "number": "13", "status": "0" } } }, { "$": { "id": "6" }, "seat": { "$": { "number": "16", "status": "0" } } }, { "$": { "id": "7" }, "seat": { "$": { "number": "19", "status": "0" } } }, { "$": { "id": "8" }, "seat": { "$": { "number": "22", "status": "0" } } }, { "$": { "id": "9" }, "seat": { "$": { "number": "25", "status": "0" } } }, { "$": { "id": "10" }, "seat": { "$": { "number": "#", "status": "blank" } } }, { "$": { "id": "11" }, "seat": { "$": { "number": "#", "status": "blank" } } }, { "$": { "id": "12" }, "seat": { "$": { "number": "#", "status": "blank" } } } ] } ] } } } }]'; $json = json_decode($string, true); foreach($json AS $array) { foreach($array AS $key => $value) { echo $key . " : " . $value . "\n"; } }
Output for 5.4.0 - 7.1.0
errorcode : 0 Notice: Array to string conversion in /in/57Yoe on line 574 xml : Array
Output for 5.2.0 - 5.3.29
errorcode : 0 xml : Array
Output for 5.0.0 - 5.1.6
Fatal error: Call to undefined function json_decode() in /in/57Yoe on line 570
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: json_decode() in /in/57Yoe on line 570
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: json_decode() in /in/57Yoe on line 570
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: json_decode() in /in/57Yoe on line 570