Bug #14264 Updated: Session variable not keeping track of increment
| From: | hholzgra@php.net | Date: | Wed, 28 Nov 2001 10:49:09 +0000 |
| Subject: | Bug #14264 Updated: Session variable not keeping track of increment | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-71899@lists.php.net to get a copy of this message | ||
ID: 14264
Updated by: hholzgra
Reported By: francis@natsoft.com.my
Old Status: Open
Status: Closed
Bug Type: Session related
Operating System: RedHat LINUX 7.2
PHP Version: 4.1.0
New Comment:
> session_start();
> $abc = '';
so what do you expect to happen when you overwrite
the value of a session variable immediately after
restoring it using session_start()?
PS:
> error_reporting(63);
*never* use numeric constants for error reporting settings, *always* use the symbolic constants like
E_ALL and E_WARNING, unless you want to get bitten by future additions of error classes
Previous Comments:
------------------------------------------------------------------------
[2001-11-28 05:42:42] francis@natsoft.com.my
With this piece of code the session variable is not keeping track of the increment:
<?php
error_reporting(63);
session_start();
$abc = '';
session_register('abc');
$abc += 1;
$_SESSION['abc'] += 2;
print "<pre>$abc\n\n";
print_r( $_SESSION);
?>
While minor alteration of above code as below the session variable works:
<?php
error_reporting(63);
$abc = '';
session_start();
session_register('abc');
$abc += 1;
$_SESSION['abc'] += 2;
print "<pre>$abc\n\n";
print_r( $_SESSION);
?>
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=14264&edit=1