note 59887 added to language.oop.serialization
| From: | maurits_dekkers at DONTSPAM_ME dot planet dot nl | Date: | Mon, 19 Dec 2005 12:35:23 +0000 |
| Subject: | note 59887 added to language.oop.serialization | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-100408@lists.php.net to get a copy of this message | ||
If you have register_globals = on, then be very careful about naming conventions when it comes to
sessions and objects.
Example:
<?php
/* Setting the session variable, which becomes "$order" if register_globals is on */
session_start()
$_SESSION["order"] = "SomeValue";
/* Instantiating an object with the same name as the session variable */
$order = new Classname;
?>
This will activate the __PHP_Incomplete_class object within your session variable! This, all
references and methods to $order will not work.
Took me hours to figure this out, so I hope this is helpful.
----
Manual Page -- http://www.php.net/manual/en/language.oop.serialization.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+59887
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+59887&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+59887&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+59887&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+59887&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+59887&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+59887&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+59887&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+59887&report=yes
Search -- http://master.php.net/manage/user-notes.php