Menu ▾ ▴

#8 Undefined index

open-accepted
nobody
None
5
2004-11-30
2004-11-15
No

I got many "Undefined index" since versions 0.7(0.8 also).

Per example, in "current.php" at line 41 (switch). It
complains about "$_REQUEST['CODE']" for which the index
"CODE" is not defined yet.

My workaround was to modify error handling in
"php.ini". by this
error_reporting = E_ALL & ~E_NOTICE

I prefer a proper code rather than putting out the notices.

My 2 cents.

Discussion

  • Enigma

    Enigma - 2004-11-15

    Logged In: YES
    user_id=1128066

    Since PHP defaults undefined variables to an empty string, I saw no need to run an isset() in a conditional and check for that and took advantage of that behavioral attribute.

     
  • Massimiliano Franco

    Logged In: YES
    user_id=294123

    Yep, that's right.
    This is a matter of color and taste. It was my preference :)

    Anyway, I hope that PHP will not change this behaviour ...

    And once again.... thx for your job. I appreciate it. I use
    it daily

     
  • Massimiliano Franco

    • status: open --> open-accepted
     

Log in to post a comment.