3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { private $data = array("Foo"); public function __sleep() { return array("data"); } } class Bar implements Serializable{ private $data = array("Bar"); public function serialize() { return serialize($this->data); } public function unserialize($data) { $this->data = unserialize($data); } public function __sleep() { echo "this won't get called"; exit; } } $foo = new Foo; $bar = new Bar; var_dump(serialize($foo)); var_dump(serialize($bar));