I’ve inherited some legacy code, within which if I turn on:
error_reporting(E_ALL);
I get literally hundreds of messages all over our site, all of them like:
Warning: include_once() [function.include]: Failed opening '../inc/variables.php' for inclusion (include_path='.:/usr/local/lib/php') in /var/www/html/xyz/xyz/xyz/payment.class.php on line 9
Notice: Undefined index: validateArrayName in /var/www/html/xyz/xyz/xyz/payment.class.php on line 3417
Notice: Undefined variable: objInstructor in /var/www/html/xyz/xyz/xyz/classes/metatags_class.php on line 44
Is this a bad thing? The site works fine otherwise, but I’m wondering if its
(a) a really bad thing and
(b) even if not, is it worthwhile to go fix all these issues?
There is lots of things you cannot test from the UI of an application. Stuff that happens under the hood. Unless your application is fully Unit-Tested or Functional Tested, you are likely not seeing the whole picture by clicking yourself through it.
You should definitely look into the Warnings. The developer probably didnt include
variables.phpfor fun, so you should double check thatpayment.phpworks as expected.Notices are less severe but they are still indicators of sloppy code. Usually, they are not that hard to fix, so unless you are on a very tight budget, fix them.
You also might want to change
error_reportingfromE_ALLto-1. That will enable all erros plusE_STRICTerrors and anything that might be added to PHP in later versions.