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

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
User avatar
phice
Moderator
Posts: 1416
Joined: Sat Apr 20, 2002 3:14 pm
Location: Dallas, TX
Contact:

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

Post 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.
Image Image
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

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

Post 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.
User avatar
vigge89
Forum Regular
Posts: 875
Joined: Wed Jul 30, 2003 3:29 am
Location: Sweden

Post 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.
The Monkey
Forum Contributor
Posts: 168
Joined: Tue Mar 09, 2004 9:05 am
Location: Arkansas, USA

Post 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
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

E_ALL.

I dislike E_STRICT for the same reason you mentioned, phice.
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

same as vigge89
User avatar
phice
Moderator
Posts: 1416
Joined: Sat Apr 20, 2002 3:14 pm
Location: Dallas, TX
Contact:

Post by phice »

I use @ in front of variables that might not be set to get rid of those notices. :P
Image Image
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

E_ALL everywhere with error_log and log_errors turned on and display_errors turned off on production servers.
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

Post 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.
Post Reply