3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { protected $foo = 123; } $foo = new Foo(); $serializedFoo = serialize($foo); $unserializedFoo = unserialize($serializedFoo, ['allowed_classes' => [Foo::class]]); var_dump($serializedFoo, $unserializedFoo);
Output for 7.1.6
string(33) "O:3:"Foo":1:{s:6:"*foo";i:123;}" object(Foo)#2 (1) { ["foo":protected]=> int(123) }