#22245 [Asn]: Unserialize Problem with References:
| From: | goth at php-resource dot de | Date: | Mon, 17 Feb 2003 13:19:17 +0000 |
| Subject: | #22245 [Asn]: Unserialize Problem with References: | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-33310@lists.php.net to get a copy of this message | ||
ID: 22245
User updated by: goth at php-resource dot de
Reported By: goth at php-resource dot de
Status: Assigned
Bug Type: Session related
Operating System: LINUX
PHP Version: 4CVS-2003-02-16 (stable)
Assigned To: sas
New Comment:
Hello,
probably a hint:
my php4-STABLE-200302071830 works fine ...
php430 does not ... so as php4-STABLE-200302162230
Previous Comments:
------------------------------------------------------------------------
[2003-02-16 21:29:16] goth at php-resource dot de
Hello,
I've got a Problem unserializing variables which are a reference. An to
me it seems to be a bug ... !
Example:
session_start();
$_SESSION["A"]=10;
$_SESSION["B"]=&$_SESSION["A"];
is correctly serialized to:
A|i:10;B|R:1;
I am happy ... ;)
But if I call this session again ... maybe the next page PHP seems to
loose the information that B was a reference.
Example:
session_start();
echo "BEFORE: A=".$_SESSION["A"]."<br />";
echo "BEFORE: B=".$_SESSION["B"]."<br />";
$_SESSION["A"]++;
echo "AFTER: A=".$_SESSION["A"]."<br />";
echo "AFTER: B=".$_SESSION["B"]."<br />";
It results to:
BEFORE: A=10
BEFORE: B=10
AFTER: A=11
AFTER: B=10
where I thought of A and B having the same value ... for B beeing a
reference to A ...
@sniper: Please don't answer ... your arrogant (and almost dumb)
answers cause me one heart-attack after the other ... !!!!!!
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=22245&edit=1