3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $stuff = '{ "input": { "is_tall": [ "BOOLEAN", false ], "profile": { "fav_color": [ "STRING", true ], "sport": [ "STRING", true ] }, "awesome": "BOOLEAN" } }'; $what = json_decode($stuff); //var_dump($what); echo "is is_tall an array???<br>"; echo is_array($what['is_tall'])."<br><br>"; echo "is profile an array???<br>"; echo is_array($what['profile'])."<br><br>";
Output for 7.0.0 - 7.1.0
is is_tall an array???<br> Fatal error: Uncaught Error: Cannot use object of type stdClass as array in /in/L8jKh:27 Stack trace: #0 {main} thrown in /in/L8jKh on line 27
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
is is_tall an array???<br> Fatal error: Object does not implement ArrayAccess in /in/L8jKh on line 27
Process exited with code 255.
Output for 5.2.0 - 5.6.28
is is_tall an array???<br> Fatal error: Cannot use object of type stdClass as array in /in/L8jKh on line 27
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Call to undefined function json_decode() in /in/L8jKh on line 23
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: json_decode() in /in/L8jKh on line 23
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: json_decode() in /in/L8jKh on line 23
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: json_decode() in /in/L8jKh on line 23