By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,890 Members | 1,048 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,890 IT Pros & Developers. It's quick & easy.

Wanted - Undefined variable errors

P: n/a
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.
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Bill Godfrey wrote:
Is there any way please I can make the PHP interpreter report "undefined
variable" errors, instead of replacing unknown variables with nothing?


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. |
Jul 17 '05 #2

P: n/a
bi**********@sunny-coventry.invalid (Bill Godfrey) wrote in message news:<20*******************@newsreader.com>...
Hello.

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


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

error_reporting(E_ALL);
ini_set('display_errors', 1);

_Or_ fix your ini file settings.

--
| Just another PHP saint |
Email: rrjanbiah-at-Y!com
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.