3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $str = ' {"numRecordings":"87","numSpecies":"1","page":1,"numPages":1,"recordings":[{"id":"176356","gen":"Picoides","sp":"pubescens","ssp":"","en":"Downy Woodpecker","rec":"Jorge de Leon Cardozo","cnt":"United States","loc":"STORRS MANSFIELD, Tolland, Connecticut","lat":"41.8349","lng":"-72.1974","type":"drumming","file":"http:\/\/www.xeno-canto.org\/176356\/download","lic":"http:\/\/creativecommons.org\/licenses\/by-nc-sa\/4.0\/","url":"http:\/\/www.xeno-canto.org\/176356"}} '; $json = json_decode($str); $distance = $json->numRecordings[0]->value; var_dump($distance);
Output for 7.2.0 - 7.3.0rc4
Notice: Trying to get property 'numRecordings' of non-object in /in/WplAc on line 6 Notice: Trying to get property 'value' of non-object in /in/WplAc on line 6 NULL
Output for 5.2.0 - 5.6.30, 7.0.0 - 7.1.20
Notice: Trying to get property of non-object in /in/WplAc on line 6 Notice: Trying to get property of non-object in /in/WplAc on line 6 NULL
Output for hhvm-3.10.1 - 3.17.3
Notice: Cannot access property on non-object in /in/WplAc on line 6 Notice: Cannot access property on non-object in /in/WplAc on line 6 NULL
Output for 5.0.0 - 5.1.6
Fatal error: Call to undefined function json_decode() in /in/WplAc on line 5
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: json_decode() in /in/WplAc on line 5
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: json_decode() in /in/WplAc on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: json_decode() in /in/WplAc on line 5