I found strange behavior in PHP, it looks like "inverted register globals." First try the following:
session_start(); $_SESSION['test'] = NULL; echo $_SESSION['test'];
It doesnβt output anything. Then change line 2:
session_start(); $test = 1; echo $_SESSION['test'];
This prints "1"!
This only happens if I set $ _SESSION ['test'] to NULL!
Register global variables if 100% off.
My hosting provider has PHP 5.2.17. This does not happen on my local 5.3.6.
Is this a bug or is there a setting for this?
source share