#37426 [Opn->Bgs]: variable scoping? session?

From: Date: Sat, 13 May 2006 07:11:51 +0000
Subject: #37426 [Opn->Bgs]: variable scoping? session?
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-97038@lists.php.net to get a copy of this message
ID: 37426 Updated by: johannes@php.net Reported By: winterain at gmail dot com -Status: Open +Status: Bogus Bug Type: Session related PHP Version: 4.4.2 New Comment: In PHP 4.2.0, the 'register_globals' setting default changed to 'off'. See http://www.php.net/release_4_2_0.php for more info. We are sorry about the inconvenience, but this change was a necessary part of our efforts to make PHP scripting more secure and portable. . Previous Comments: ------------------------------------------------------------------------ [2006-05-13 02:35:35] winterain at gmail dot com Description: ------------ hello... i'm having problem here... example, i got 2 files... 1st file contains (test.php) <?php session_start(); $_SESSION['xxx']="hello"; $xxx="world"; echo $xxx; echo "<br>".$_SESSION['xxx']; ?> then the 2nd file (test2.php) <?php session_start(); $xxx="world"; echo $xxx; echo "<br>".$_SESSION['xxx']; ?> if i'm goin to use PHP 4 for those files (say access test.php 1st, then next test2.php)... test.php would output "world hello"... and test2.php would output "world hello"... the problem rises when i used PHP 5... 1st file would output "world hello" but the 2nd file's output is "world world"... apparently, the $_SESSION['xxx'] value changed whenever $xxx value changes... is this some kind of bug under variable scoping? ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=37426&edit=1

« previous php.bugs (#97038) next »