note 71251 deleted from function.serialize by aharvey
| From: | aharvey@php.net | Date: | Tue, 06 Nov 2012 02:11:14 +0000 |
| Subject: | note 71251 deleted from function.serialize by aharvey | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-191774@lists.php.net to get a copy of this message | ||
Note Submitter: admin at goodsoft dot lv
----
When I serialized an object and looked into resulting string, I mentioned that all private
properties' names were prefixed by class name.
This code:
<?php
class myclass {
private $priv1 = "val1",
$myclasspriv2 = "val2";
public $pub = "val3";
}
$inst = new myclass ();
echo serialize($inst);
?>
resulted in (don't look at word wrapping):
O:7:"myclass":3:{s:14:"myclasspriv1";
s:4:"val1";s:21:"myclassmyclasspriv2";
s:4:"val2";s:3:"pub";s:4:"val3";}