Start PHP Code RESULT
O:5:"apple":2:{s:6:"flavor";s:5:"sweet";s:6:"frozen";i:1;}
This apple has been frozen 1 time(s)
End PHP Code RESULT
The PHP Code START
class apple {
    
    var $flavor = "sweet";
    var $frozen = 0;
    function __sleep() {
      $this->frozen++;
      return array_keys(get_object_vars($this));
    }
    function __wakeup() {
      print "This apple has been frozen ".$this->frozen." time(s)";
    }
}
    
$app = new apple();
$stored = serialize($app);
print $stored;
$new_app = unserialize($stored);
The PHP Code END