Page 1 of 1

php error reporting... which one do you use?

Posted: Sun Oct 24, 2004 10:39 pm
by phice
For those who use [php_man]error_reporting[/php_man], I'm interested in what setting you use for this function. I would use E_STRICT, but it shows notices for using 'var' in front of setting variables inside a class, so I end up using E_ALL.

Also, please specify why.

Re: php error reporting... which one do you use?

Posted: Sun Oct 24, 2004 11:55 pm
by Roja
phice wrote:For those who use [php_man]error_reporting[/php_man], I'm interested in what setting you use for this function. I would use E_STRICT, but it shows notices for using 'var' in front of setting variables inside a class, so I end up using E_ALL.

Also, please specify why.
I'm still on php4 for most of my deployment target (webhosts), so I develop using E_ALL on php4, and when deploying (production), I leave it to the server default (which is usually E_ERROR only or similar).

I have one test host running php5, (dotgeek rules!), but even there, I dont use E_STRICT.. its just not realistic.

Posted: Mon Oct 25, 2004 7:32 am
by vigge89
I'm using E_ALL & ~E_NOTICE on my local PHP5 Apache2 server, since I want to know of any problems my scripts can occur, but I also hate the notices when an variable is uninitialized.

Posted: Mon Oct 25, 2004 7:41 am
by The Monkey
When developing, I leave it on E_ALL; then when I consider the project "done" and the users come in, I set it to E_NONE and use error_log to record any errors in a directory unaccessable to my users.

I couple that with plenty of return FALSE checks in my query functions, so if something goes wrong, I can provide a custom error message to my user, and let the script continue on it's way. Works great.

- Monkey

Posted: Mon Oct 25, 2004 10:26 am
by m3mn0n
E_ALL.

I dislike E_STRICT for the same reason you mentioned, phice.

Posted: Mon Oct 25, 2004 12:01 pm
by patrikG
same as vigge89

Posted: Mon Oct 25, 2004 12:24 pm
by phice
I use @ in front of variables that might not be set to get rid of those notices. :P

Posted: Mon Oct 25, 2004 12:42 pm
by Weirdan
E_ALL everywhere with error_log and log_errors turned on and display_errors turned off on production servers.

Posted: Tue Oct 26, 2004 6:32 am
by phpScott
I follow Weirdan's example. Everything for me and nothing for the clients.
I don't want them to know any mistakes I may of made I just want them to magically be fixed.