Top SEM and SEO Tips    

Typical Lazy PHP Programmer

August 27, 2008 – 4:50 pm

That’s me, write a program and it works, don’t bother initializing variables, etc. That was until I moved to a new host that had display errors turned off. It is pretty much impossible to debug without errors being displayed so I went rummaging around for ways around this and found the following code:

error_reporting(E_ALL);
ini_set(“display_errors”,1);

I turned this on and suddenly the code was spitting out warnings and messages all over the place. Some trivial but some really fixed issues that I didn’t know. Now I’ve got it turned on all the time in development and on internal systems.

As the ‘Practical PHP Programming’ manual says:
Always set your PHP error level to the most verbose level, E_ALL. All too often people don’t realise that PHP is outputting various complaints about variables not being set, etc, which you can just do away with entirely by cleaning up your code.

No related posts.

One thought on “Typical Lazy PHP Programmer

  1. [...] links >> programmer Real-Time Collision Detection review Saved by Konpyuta on Mon 01-12-2008 Typical Lazy PHP Programmer Saved by tstahmer on Tue 11-11-2008 How to Separate an Egg Saved by mistress018 on Tue 04-11-2008 [...]

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*