3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $someJson = '{"":""}'; $myObject = json_decode($someJSON); $newJson = json_encode($myObject); var_dump($someJson, $newJson, $someJson === $newJson); $myObject = (object)[""=>""]; $serialized = serialize($myObject); var_dump($myObject, $serialized); $unserialized = unserialize($myObject); var_dump($unserialized);
based on N02ZD
Output for 5.6.21 - 5.6.28, 7.0.6 - 7.2.0
Notice: Undefined variable: someJSON in /in/3037d on line 4 string(7) "{"":""}" string(4) "null" bool(false) object(stdClass)#1 (1) { [""]=> string(0) "" } string(33) "O:8:"stdClass":1:{s:0:"";s:0:"";}" Warning: unserialize() expects parameter 1 to be string, object given in /in/3037d on line 12 bool(false)
Output for 5.5.0 - 5.6.20, 7.0.0 - 7.0.5
Notice: Undefined variable: someJSON in /in/3037d on line 4 string(7) "{"":""}" string(4) "null" bool(false) object(stdClass)#1 (1) { Notice: Illegal member variable name in /in/3037d on line 11 [""]=> string(0) "" } string(33) "O:8:"stdClass":1:{s:0:"";s:0:"";}" Warning: unserialize() expects parameter 1 to be string, object given in /in/3037d on line 12 bool(false)