From: voodoo at mail dot ru Operating system: Linux 2.6.15-1.1833_FC4smp PHP version: 5.1.2 PHP Bug Type: Session related Bug description: No session data saved after working with $GLOBALS in object
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 bug report at http://bugs.php.net/?id=36829&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=36829&r=trysnapshot44 Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=36829&r=trysnapshot51 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=36829&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=36829&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=36829&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=36829&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=36829&r=needscript Try newer version: http://bugs.php.net/fix.php?id=36829&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=36829&r=support Expected behavior: http://bugs.php.net/fix.php?id=36829&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=36829&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=36829&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=36829&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36829&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=36829&r=dst IIS Stability: http://bugs.php.net/fix.php?id=36829&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=36829&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=36829&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=36829&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=36829&r=mysqlcfg