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
Warning: unserialize(): allowed_classes option should be array or boolean in /in/Fc9Td on line 11 string(33) "O:3:"Foo":1:{s:6:"*foo";i:123;}" bool(false)