#36829 [Opn->Bgs]: No session data saved after working with $GLOBALS in object

From: Date: Thu, 23 Mar 2006 08:11:39 +0000
Subject: #36829 [Opn->Bgs]: No session data saved after working with $GLOBALS in object
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-94802@lists.php.net to get a copy of this message
ID: 36829 Updated by: tony2001@php.net Reported By: voodoo at mail dot ru -Status: Open +Status: Bogus Bug Type: Session related Operating System: Linux 2.6.15-1.1833_FC4smp PHP Version: 5.1.2 New Comment: Thank you for taking the time to report a problem with PHP. Unfortunately you are not using a current version of PHP -- the problem might already be fixed. Please download a new PHP version from http://www.php.net/downloads.php If you are able to reproduce the bug with one of the latest versions of PHP, please change the PHP version on this bug report to the version you tested and change the status back to "Open". Again, thank you for your continued support of PHP. Previous Comments: ------------------------------------------------------------------------ [2006-03-23 07:06:51] voodoo at mail dot ru Description: ------------ No session data saved after working with $GLOBALS in object. In detail, when I put $GLOBALS in class var and try to change session variable, stored in $_SESSION, session variable haven't been changed. When placing $obj = new test after $_SESSION['test'] increment, it's all seems to be OK. PHP 5.0.4 (cli) (built: Jul 27 2005 12:29:26) (couldn't find it in PHP version list) Reproduce code: --------------- <?php session_start(); $obj = new test; echo $_SESSION['test']++; class test { var $vars; function test() { foreach ($GLOBALS as $k => $v) { $this->vars[$k] = $v; } } } ?> Expected result: ---------------- Increment at each page reload Actual result: -------------- no output ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36829&edit=1

« previous php.bugs (#94802) next »