PHP 4.0 Bug #3261: sess_register doesn't register global variables correctly
| From: | stas at zend dot com | Date: | Thu, 20 Jan 2000 17:40:36 +0000 |
| Subject: | PHP 4.0 Bug #3261: sess_register doesn't register global variables correctly | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-14788@lists.php.net to get a copy of this message | ||
From: stas@zend.com
Operating system: Linux
PHP version: 4.0 Latest CVS (20/01/2000)
PHP Bug Type: Misbehaving function
Bug description: sess_register doesn't register global variables correctly
The script:
<?php
session_name("XSession");
function start() {
global $count;
session_start();
session_register("count");
var_dump($count);
}
function see() {
global $count;
print "Here: $count<br>";
}
$count=0;
start();
see();
$count++;
?>
shows:
int(0) Here: N
where N is the correct current value of $count. Note that if I put global after session_register,
it works OK.