PHP declaring global and session variables -
i'm been using php5.3.8 while , i've come across new error me;
warning: unknown: script possibly relies on session side-effect existed until php 4.2.3. please advised session extension not consider global variables source of data, unless register_globals enabled. can disable functionality , warning setting session.bug_compat_42 or session.bug_compat_warn off, respectively. in unknown on line 0
to there solution here; php session side-effect warning global variables source of data.
however, still don't understand why happening. far i'm aware, there should no ambiguity between $foo , $_session['foo']?
i've tried testing few of scripts online people throw error, don't throw warning on system, , script i'm getting warning on hella complicated , stripping down few lines in order replicate error proving problematic.
however, have narrowed down 1 line;
$bonus = isset($_get['bonus']) ? $_get['bonus'] : ''; $_session['bonus'] set null in previous page, , register_globals has been off since php4.2 something, can't $_get scope.
so brings me first point; why there issue between $bonus , $_session['bonus']? suddenly, because using exact script on site (same box) , no errors.
could point me anywhere perhaps explains in more detail how php deals session vars etc , why there issue between 2 variables?
thanks.
[update]
looking here; php runtime configuration mention that:
[php has...] undocumented feature/bug allows initialize session variable in global scope...
i guess there may not more other that. seems odd me php has issues $_session['foo']/$foo when $_session['foo'] != $foo...
try setting session.bug_compat_42 off, turn off functionality warning about. c.f. http://php.net/manual/en/session.configuration.php
Comments
Post a Comment