name));
fclose($f);
}
function wakeup() {
$this->name = @unserialize(
file_get_contents(SERIALIZED)
);
}
}
$p = new Person;
if ($p instanceof ISerializable) {
$p->wakeup();
}
echo "Previous Spy: {$p->name}\n
\n";
$superspies = array('James Bond',
'Sterling Hughes',
'Austin Powers');
$p->name = $superspies[array_rand($superspies)];
echo "New Spy: {$p->name}\n
\n";
if ($p instanceof ISerializable) {
$p->sleep();
}
?>