3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $jsonstr = <<<EOT { "myObject": { "foo":"bar", "foo2":"bar2" } } EOT; $parsed = json_decode($jsonstr); var_dump($parsed);
based on hQjnY
Output for 7.0.0 - 7.2.0
object(stdClass)#2 (1) { ["myObject"]=> object(stdClass)#1 (2) { ["foo"]=> string(3) "bar" ["foo2"]=> string(4) "bar2" } }
Output for 5.3.19 - 5.6.28
object(stdClass)#1 (1) { ["myObject"]=> object(stdClass)#2 (2) { ["foo"]=> string(3) "bar" ["foo2"]=> string(4) "bar2" } }