#28144 [Opn->Csd]: Session variably overwritten with global variable

From: Date: Sun, 25 Apr 2004 16:24:33 +0000
Subject: #28144 [Opn->Csd]: Session variably overwritten with global variable
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-58733@lists.php.net to get a copy of this message
ID: 28144 Updated by: iliaa@php.net Reported By: nick at blackisha dot com -Status: Open +Status: Closed Bug Type: Scripting Engine problem Operating System: debian testing PHP Version: 4.3.4 New Comment: Thank you for your bug report. This issue has already been fixed in the latest released version of PHP, which you can download at http://www.php.net/downloads.php Appears to be fixed in 4.3.6 Previous Comments: ------------------------------------------------------------------------ [2004-04-25 14:24:44] nick at blackisha dot com Description: ------------ When a class is instantiated globally, and assigned to a variable name which is the same as a session variable, then the session variable get overwritten with the class. This may happen with non-class variables, but I am not sure. Reproduce code: --------------- changing $entrain to anything else (i.e. $entra) fixes the problem. <?php session_start(); $entrain = new entrainRuntime(); var_dump($_SESSION); class entrainRuntime { function entrainRuntime () { $_SESSION['entrain'] = array(); } } ?> Expected result: ---------------- array(1) {"entrain" => array(0) {}} this happens the first time, expected Actual result: -------------- On subsequent refreshes: array(1) {"entrain" => &bject(entrainruntime)(0) {}} ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28144&edit=1

« previous php.bugs (#58733) next »