3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $source = <<<SOURCE { "head": { "comm": 7, "compress": false, "ms": 1451029423348, "encrypt": false, "version": 2 }, "body": { "data1": 0, "data2": 59, "data3": -40, "data4": 0, "data5": 0 } } SOURCE; $string = get_magic_quotes_gpc() ? stripslashes($source) : $source; $object = json_decode($string); var_dump($object);
Output for 7.0.0 - 7.2.0
object(stdClass)#2 (2) { ["head"]=> object(stdClass)#1 (5) { ["comm"]=> int(7) ["compress"]=> bool(false) ["ms"]=> int(1451029423348) ["encrypt"]=> bool(false) ["version"]=> int(2) } ["body"]=> object(stdClass)#3 (5) { ["data1"]=> int(0) ["data2"]=> int(59) ["data3"]=> int(-40) ["data4"]=> int(0) ["data5"]=> int(0) } }
Output for 5.3.21 - 5.6.28
object(stdClass)#1 (2) { ["head"]=> object(stdClass)#2 (5) { ["comm"]=> int(7) ["compress"]=> bool(false) ["ms"]=> int(1451029423348) ["encrypt"]=> bool(false) ["version"]=> int(2) } ["body"]=> object(stdClass)#3 (5) { ["data1"]=> int(0) ["data2"]=> int(59) ["data3"]=> int(-40) ["data4"]=> int(0) ["data5"]=> int(0) } }