Wanted - Undefined variable errors

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bill Godfrey

    Wanted - Undefined variable errors

    Hello.

    Is there any way please I can make the PHP interpreter report "undefined
    variable" errors, instead of replacing unknown variables with nothing?

    Three times today, I've tracked an error down to using a non-existant
    variable which had arrived though a typo or a scoping error.

    Many thanks.

    Bill, trying to learn.
  • Pedro Graca

    #2
    Re: Wanted - Undefined variable errors

    Bill Godfrey wrote:[color=blue]
    > Is there any way please I can make the PHP interpreter report "undefined
    > variable" errors, instead of replacing unknown variables with nothing?[/color]

    Yes.

    Try http://www.php.net/error_reporting


    You may want to change your php.ini to have PHP default to reporting all
    errors it finds.


    HTH

    --
    USENET would be a better place if everybody read: | to email me: use |
    http://www.catb.org/~esr/faqs/smart-questions.html | my name in "To:" |
    http://www.netmeister.org/news/learn2quote2.html | header, textonly |
    http://www.expita.com/nomime.html | no attachments. |

    Comment

    • R. Rajesh Jeba Anbiah

      #3
      Re: Wanted - Undefined variable errors

      bill-godfrey@sunny-coventry.invalid (Bill Godfrey) wrote in message news:<200406221 91436.759$kz@ne wsreader.com>.. .[color=blue]
      > Hello.
      >
      > Is there any way please I can make the PHP interpreter report "undefined
      > variable" errors, instead of replacing unknown variables with nothing?[/color]

      Try adding the following two lines in the beginning of all your scripts:

      error_reporting (E_ALL);
      ini_set('displa y_errors', 1);

      _Or_ fix your ini file settings.

      --
      | Just another PHP saint |
      Email: rrjanbiah-at-Y!com

      Comment

      Working...