|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-03-23 09:11 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 04 03:00:01 2025 UTC |
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