Hacking with PHP has been updated for PHP 7 - click here! >>

Listen to all errors, big and small

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. While you are editing your php.ini file, it would also help to disable all the extensions you don't use - they are just chewing up memory otherwise.

 

If this was helpful, please take a moment to tell others about Hacking with PHP by tweeting about it!

Next chapter: Keep up to date >>

Previous chapter: Be wary of garbage collection, part 2

Jump to:

 

Home: Table of Contents

Copyright ©2015 Paul Hudson. Follow me: @twostraws.