note 83427 added to language.oop5.visibility
| From: | ted-talks at codeoflife dot ca | Date: | Mon, 26 May 2008 03:31:31 +0000 |
| Subject: | note 83427 added to language.oop5.visibility | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-139773@lists.php.net to get a copy of this message | ||
I recently began updating my code to PHP 5 standands by adding the visibility prefaces: public,
protected, private. I then discovered that serialized objects from the database weren't updated
as I thought they would be.
Before updating:
[code]
object(Foo) {
["bar"]=>
string(0) "banana"
}
[/code]
After adding visibility and viewing an unserialized Foo object:
[code]
object(Foo) {
["bar:protected"]=>
string(0) ""
["bar"]=>
string(6) "banana"
}
[/code]
During unserlialization, it seems to have created two different "bar" variables.. one
public and one protected.
Any idea why PHP would be doing this? It completely messes up my framework.
Thanks.
----
Server IP: 69.147.83.197
Probable Submitter: 154.5.117.214
----
Manual Page -- http://www.php.net/manual/en/language.oop5.visibility.php
Edit -- https://master.php.net/note/edit/83427
Del: integrated -- https://master.php.net/note/delete/83427/integrated
Del: useless -- https://master.php.net/note/delete/83427/useless
Del: bad code -- https://master.php.net/note/delete/83427/bad+code
Del: spam -- https://master.php.net/note/delete/83427/spam
Del: non-english -- https://master.php.net/note/delete/83427/non-english
Del: in docs -- https://master.php.net/note/delete/83427/in+docs
Del: other reasons-- https://master.php.net/note/delete/83427
Reject -- https://master.php.net/note/reject/83427
Search -- https://master.php.net/manage/user-notes.php