Re: PHP 4.0 Bug #7258 Updated: Dangling references destroy session state

From: Date: Mon, 23 Oct 2000 14:45:05 +0000
Subject: Re: PHP 4.0 Bug #7258 Updated: Dangling references destroy session state
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-35887@lists.php.net to get a copy of this message
hi, On Mon, Oct 23, 2000 at 09:03:03AM -0000, Bug Database wrote: > ID: 7258 > Updated by: stas > Reported By: sd@b-comp.de > Status: Feedback > Bug Type: Scripting Engine problem > Assigned To: > Comments: > > Please check current CVS, it should be fixed > > Previous Comments: > --------------------------------------------------------------------------- > > [2000-10-16 16:08:47] sd@b-comp.de > (The problem described is specific to 4.0.3 and 4.0.3pl1. > The scripts below work fine with 4.0.2.) > > Let $a be an array kept in the session state. Whenever > a reference $x to an element of $a falls of the end of a > script, the referenced array element is destroyed. > Putting an ``undef($x);'' at the end of the script solves > the problem. The following two scripts demonstate the > problem: > > BEGIN FILE test1.php > <?php > session_register('a'); > $a = array(); > $a['foo'] = 'FOO'; > ?> > <html> > <a href="test2.php?<?=SID?>">link</a> > </html> > END FILE > > BEGIN FILE test2.php > <?php > session_register('a'); > $x = &$a['foo']; > ?> > <html> > x=<?=$x?><br> > <a href="test2.php?<?=SID?>">link</a> > </html> > END FILE > > Open test1.php in a browser and follow the link to > test2.php. You'll see that $x is 'FOO'. Now follow > that link again and $x is undefined. > > The scripts work if you put an ``undef($x);'' at the > end of test2.php. The current CVS version works for me. Thanx alot. solong, Sascha Demetrio sd@b-comp.de

« previous php.dev (#35887) next »