ID:               25739
 Updated by:       [EMAIL PROTECTED]
 Reported By:      webteam at skimtta dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Session related
 Operating System: W2K Pro, FreeBSD
 PHP Version:      4.3.4RC1
 New Comment:

Read the error message again:

"Your script possibly relies on.." <-- notice the word 'possibly'

You can silence the message by disabling either session.bug_compat_warn
or session.bug_compat_42 or both.

Read also the note in php.ini-dist above these options.



Previous Comments:
------------------------------------------------------------------------

[2003-10-02 22:25:57] webteam at skimtta dot com

Description:
------------
Session.compat_42 warning message is reported without using global
variables as a source of data.  Register globals are off.  

This warning message occurs when a local variable and a session
variable have the same name, and the session variable ends up being
assigned a NULL value - see code below.  (Note: I'm not trying to unset
the session variable. In my real code, the NULL result came from
several levels of nested function calls).

This warning message states "...the session extension does not consider
global variables as a source of data, unless register_globals is
enabled".  This does not describe this siutation.

The documentation doesn't state that local variables and session
variables must not have the same name; and the comp_42 warning message
does not cover this case either.  So this must be a bug.







Reproduce code:
---------------
    session_start();

    // WORKS:
    //   $x = 1; 
    //   $_SESSION["x"] = "";   
    // or
    //   $_SESSION["x"] = NULL;   

    // FAILS with session.bug_compat_42 warning: 
       $x = 1; 
       $_SESSION["x"] = NULL; 


Expected result:
----------------
No warning messages and not having to disable warning messages that do
not describe this situation.  (Or changes to the documentation stating
"local variables and session variables can not have the same names").

Actual result:
--------------
Warning: Unknown(): Your script possibly relies on a session
side-effect which existed until PHP 4.2.3. Please be advised that the
session extension does not consider global variables as a source of
data, unless register_globals is enabled. You can disable this
functionality and this warning by setting session.bug_compat_42 or
session.bug_compat_warn to off, respectively. in Unknown on line 0



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=25739&edit=1

Reply via email to