Bug #15289: Global variables do not work with session.

From: Date: Wed, 30 Jan 2002 03:13:12 +0000
Subject: Bug #15289: Global variables do not work with session.
Groups: php.dev 
Request: Send a blank email to php-dev+get-78490@lists.php.net to get a copy of this message
From: brubla@seznam.cz Operating system: Linux PHP version: 4.1.1 PHP Bug Type: Session related Bug description: Global variables do not work with session. Global variable will be registered in session only first time. When you will be refreshing page with following code, it will count only to 2. <?php session_start(); global $counter; //when you remove this row, all will work properly session_register("counter"); $counter++; echo $counter; ?> When you remove row with "global $counter;" page will count to 3, 4, 5... Both variants of code works properly with PHP 4.0.6 (on Windows 2000). -- Edit bug report at: http://bugs.php.net/?id=15289&edit=1

« previous php.dev (#78490) next »