ID: 37629 Comment by: judas dot iscariote at gmail dot com Reported By: phpbugs at asystance dot nl Status: Open Bug Type: Documentation problem Operating System: Windows XP / Debian Linux PHP Version: 4.4.2 New Comment:
this is a "misfeature", and I don't think It would be fixed at all in 4.4 doing so, will break a lot code... it is fixed in php6, since register_globals is gone. Just Do not use register_globals. Previous Comments: ------------------------------------------------------------------------ [2006-05-29 15:52:26] phpbugs at asystance dot nl changed version ------------------------------------------------------------------------ [2006-05-29 15:49:32] phpbugs at asystance dot nl Description: ------------ When register_globals = On (I know this is legacy), $_SESSION behaves differently than the other superglobals and this (mis)behaviour is not documented. This is actually a duplicate of (or maybe just related to) bug #25110. [EMAIL PROTECTED] calls this behaviour a "feature". I strongly disagree. What we should agree on is that it's undocumented and unexpected. Neither the documentation on register_globals nor the documentation on superglobals mentions this. It also only works with $_SESSION (and not with other superglobals), so the behaviour is very unexpected. I tested this with two debian installations (4.4.2-1+b1 on Apache 2.0.55 and 4.3.10-16.8 on Apache 1.3.33) and the latest Windows zip package 4.4.2 on Apache2. Reproduce code: --------------- <?php session_start(); $_SESSION['var'] = 'hello'; $var = 'again'; echo $_SESSION['var']; ?> Expected result: ---------------- Output is 'hello' Actual result: -------------- Output is 'again' ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=37629&edit=1
