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)array(""=>""); $serialized = serialize($myObject); var_dump($myObject, $serialized); $unserialized = unserialize($serialized); var_dump($unserialized);
based on Tg6GB
Output for 7.1.0 - 7.2.0
string(7) "{"":""}" string(7) "{"":""}" bool(true) object(stdClass)#2 (1) { [""]=> string(0) "" } string(33) "O:8:"stdClass":1:{s:0:"";s:0:"";}" object(stdClass)#1 (1) { [""]=> string(0) "" }
Output for 5.6.21 - 5.6.28, 7.0.6 - 7.0.20
string(7) "{"":""}" string(14) "{"_empty_":""}" bool(false) object(stdClass)#2 (1) { [""]=> string(0) "" } string(33) "O:8:"stdClass":1:{s:0:"";s:0:"";}" object(stdClass)#1 (1) { [""]=> string(0) "" }
Output for 5.2.0 - 5.6.20, 7.0.0 - 7.0.5
string(7) "{"":""}" string(14) "{"_empty_":""}" bool(false) object(stdClass)#2 (1) { Notice: Illegal member variable name in /in/0ifNP on line 11 [""]=> string(0) "" } string(33) "O:8:"stdClass":1:{s:0:"";s:0:"";}" object(stdClass)#1 (1) { Notice: Illegal member variable name in /in/0ifNP on line 13 [""]=> string(0) "" }
Output for 5.0.0 - 5.1.6
Fatal error: Call to undefined function json_decode() in /in/0ifNP on line 4
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: json_decode() in /in/0ifNP on line 4
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: json_decode() in /in/0ifNP on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: json_decode() in /in/0ifNP on line 4