3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $response = json_decode('{"services": {"service": [ { "custom_name": "My Compose Service", "service_id": "73", "cloud_services": {"cloud_service": [ { "custom_name": "My Personal TAI Cloud", "service_id": "71" }, { "custom_name": "My Professional TAI Cloud", "service_id": "72" }, null ]} }, null ]}}', true); var_dump(iterator_to_array(new RecursiveArrayIterator($response)));
based on b6JWH
Output for 5.2.0 - 7.2.0
array(1) { ["services"]=> array(1) { ["service"]=> array(2) { [0]=> array(3) { ["custom_name"]=> string(18) "My Compose Service" ["service_id"]=> string(2) "73" ["cloud_services"]=> array(1) { ["cloud_service"]=> array(3) { [0]=> array(2) { ["custom_name"]=> string(21) "My Personal TAI Cloud" ["service_id"]=> string(2) "71" } [1]=> array(2) { ["custom_name"]=> string(25) "My Professional TAI Cloud" ["service_id"]=> string(2) "72" } [2]=> NULL } } } [1]=> NULL } } }
Output for 5.0.0 - 5.1.6
Fatal error: Call to undefined function json_decode() in /in/FuTde on line 3
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: json_decode() in /in/FuTde on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: json_decode() in /in/FuTde on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: json_decode() in /in/FuTde on line 3