<?php
class Foo {}
class Bar implements Serializable{
public function serialize() {
return "foobar";
}
public function unserialize($data) {
}
}
$foo = new Foo;
$bar = new Bar;
var_dump(serialize($foo));
var_dump(serialize($bar));
Deprecated: Bar implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /in/CXBCB on line 5
string(14) "O:3:"Foo":0:{}"
string(20) "C:3:"Bar":6:{foobar}"