Bug #14264 Updated: Session variable not keeping track of increment

From: Date: Wed, 28 Nov 2001 10:49:29 +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-71900@lists.php.net to get a copy of this message
ID: 14264 Updated by: hholzgra Reported By: francis@natsoft.com.my Old Status: Closed Status: Bogus Bug Type: Session related Operating System: RedHat LINUX 7.2 PHP Version: 4.1.0 New Comment: (bogusified) Previous Comments: ------------------------------------------------------------------------ [2001-11-28 05:49:09] hholzgra@php.net > 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 ------------------------------------------------------------------------ [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

« previous php.dev (#71900) next »