Testing Your PHP Code—Getting It Down the First Time!
My little practice of doing it right the first time and thoroughly testing it the first time has proven it’s self over and over.
When your developing a certain functionality or feature for a PHP program you have to understand at which levels your code will run. PHP can be very runny and lets your do too much in terms of poor coding practice. So you need to discipline yourself, like in any programming lanuage. Unless you test everything the chance of bugs occurring in your code rises. It all comes down to understanding your code and knowing exactly what it’s doing.
My three tips for testing PHP:
- Turn on all errors, warning and notice flags.
- Play around with your code, find the weak spots, code more and then test it again.
- Know the factors of stress brought onto your code in different situations.
Properly testing your code will save you hours, days or even weeks of hair pulling and headaches. Do it right the first time and you wont have to cut through a tone of messy wires and get electrocuted later on.
-Clinton




