I'm getting a strange error in one of my programs:
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
Funny thing is I'm not using any globals at all in my script, but I am using $_SESSION. I even did grep GLOBAL *.php in my directory in case it's in one of the functions I included and nothin'. Strangely the error is output at the very end of the code (after a simple print statement which is before the closing php tag). I don't see the point in messing with register_globals when I don't use globals so am hoping for another solution. Any ideas?
PHP versions 4.2.3 and lower have an undocumented feature/bug that allows you to initialize a session variable in the global scope, albeit register_globals is disabled. PHP 4.3.0 and later will warn you, if this feature is used, and if session.bug_compat_warn is also enabled. This feature/bug can be disabled by disabling this directive.
Thanks for the info. Thing is I want the script to be portable without having to change register_globals and also I don't actually want to use globals.
Woah, just found the problem. I kept putting in die statements in my code starting at the end and moving up until I isolated the line that triggered the error (error was being shown at end but actually being triggerd somewhere in the middle). I was setting a certain variable, non global, non session. I re-named the variable and the error goes away. I'm using PEAR so my guess is there is an identical variable in PEAR in the global scope or something. Jeesh.