Bug #15310: when use object method call session register doesn't work
| From: | nail at bowling dot nsk dot su | Date: | Thu, 31 Jan 2002 09:50:24 +0000 |
| Subject: | Bug #15310: when use object method call session register doesn't work | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-78671@lists.php.net to get a copy of this message | ||
From: nail@bowling.nsk.su
Operating system: linux
PHP version: 4.1.1
PHP Bug Type: Session related
Bug description: when use object method call session register doesn't work
Following code the shows strange bag.
When function t() called as object method, variable 'time' is not kept in
session.
Register_globals is On.
<?php
session_start();
class Test {
var $mT = array();
// this function does not deal with session
function t()
{
reset($GLOBALS);
while (list($k,$v)=each($GLOBALS))
$GLOB[$k]=$v;
$this->mT['TEST'] = $GLOB;
}
}
$test = new Test;
$test->t(); // comment this line and script will work right
?>
<pre>
<?php
print_r($_SESSION);
$_SESSION['time'] = time();
session_register('time');
echo "\n-------new _SESSION:-----------\n\n";
print_r($_SESSION); echo "\n";
?>
</pre>
--
Edit bug report at: http://bugs.php.net/?id=15310&edit=1