Created
December 12, 2012 19:33
-
-
Save anonymous/4270832 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class ser extends stdClass implements Serializable { | |
| var $prop; | |
| public function __construct() { | |
| $this->prop = "Property Value"; | |
| } | |
| public function serialize() { | |
| $obj = new stdClass(); | |
| $obj->prop = $this->prop; | |
| return serialize($obj); | |
| } | |
| public function unserialize($data) { | |
| } | |
| } | |
| $s = new ser(); | |
| var_dump(serialize($s)); | |
| // Output: | |
| // string(67) "C:3:"ser":52:{O:8:"stdClass":1:{s:4:"prop";s:14:"Property Value";}}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment