note 71251 added to function.serialize
| From: | admin at goodsoft dot lv | Date: | Sun, 19 Nov 2006 16:25:00 +0000 |
| Subject: | note 71251 added to function.serialize | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-119869@lists.php.net to get a copy of this message | ||
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";}
----
Server IP: 81.94.227.69
Probable Submitter: 81.198.61.143
----
Manual Page -- http://www.php.net/manual/en/function.serialize.php
Edit -- https://master.php.net/note/edit/71251
Del: integrated -- https://master.php.net/note/delete/71251/integrated
Del: useless -- https://master.php.net/note/delete/71251/useless
Del: bad code -- https://master.php.net/note/delete/71251/bad+code
Del: spam -- https://master.php.net/note/delete/71251/spam
Del: non-english -- https://master.php.net/note/delete/71251/non-english
Del: in docs -- https://master.php.net/note/delete/71251/in+docs
Del: other reasons-- https://master.php.net/note/delete/71251
Reject -- https://master.php.net/note/reject/71251
Search -- https://master.php.net/manage/user-notes.php