PHP 4.0 Bug #3261 Updated: sess_register doesn't register global variables correctly

From: Date: Sun, 19 Nov 2000 13:14:35 +0000
Subject: PHP 4.0 Bug #3261 Updated: sess_register doesn't register global variables correctly
Groups: php.dev 
Request: Send a blank email to php-dev+get-38495@lists.php.net to get a copy of this message
ID: 3261 Updated by: stas Reported By: stas@zend.com Status: Closed Bug Type: *General Issues Assigned To: stas Comments: Fixed in CVS. Previous Comments: --------------------------------------------------------------------------- [2000-08-15 10:29:38] waldschrott@php.net Note, the manual says: "If both track_vars and register_globals are enabled, then the globals variables and the $HTTP_SESSION_VARS entries will reference the same value." Thus a variable made global a before session_start()´s should be updated accordingly --------------------------------------------------------------------------- [2000-08-15 10:28:02] waldschrott@php.net duped out 6161, following code doesn´t behave equally (register_globals=on) function increment_0() { global $a; session_start(); $a += 1; } function increment_1() { session_start(); global $a; $a += 1; } --------------------------------------------------------------------------- [2000-08-15 09:38:10] waldschrott@php.net This is a dup. --------------------------------------------------------------------------- [2000-07-30 09:46:56] zak@php.net Has there been any progress on this bug? --------------------------------------------------------------------------- [2000-05-14 04:34:13] stas@zend.com What do you mean "unless specified"? Did you look at the code: function start() { global $count; // If *this* is not specification of global, what is? session_start(); session_register("count"); var_dump($count); // Which "count" is 0 here? If global, why it isn't 0 below? // If local, what happened to "global" $count I just defined and // how do I specify that I want *that* *global* count, and not // want to create new local one to override old one? } function see() { global $count; print "Here: $count<br>"; // And *how exactly* I got the right value here if session variable wasn't global? } --------------------------------------------------------------------------- The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online. Full Bug description available at: http://bugs.php.net/?id=3261

« previous php.dev (#38495) next »