3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { private $bar; private $baz; public function __construct($bar, $baz) { $this->bar = $bar; $this->baz = $baz; } } $foo = new Foo('hello','word'); $json = json_encode($foo); echo $json; $serialize = serialize($foo); echo $serialize; var_dump( json_decode($json) ); var_dump( deserialize($serialize) );
based on sn8JQ
Output for 7.0.0 - 7.2.0
{}O:3:"Foo":2:{s:8:"Foobar";s:5:"hello";s:8:"Foobaz";s:4:"word";}object(stdClass)#2 (0) { } Fatal error: Uncaught Error: Call to undefined function deserialize() in /in/2JcFT:24 Stack trace: #0 {main} thrown in /in/2JcFT on line 24
Process exited with code 255.
Output for 5.4.0 - 5.6.28
{}O:3:"Foo":2:{s:8:"Foobar";s:5:"hello";s:8:"Foobaz";s:4:"word";}object(stdClass)#2 (0) { } Fatal error: Call to undefined function deserialize() in /in/2JcFT on line 24
Process exited with code 255.