Handling PHP errors paves the way for resilient code For the past 72 articles, we’ve lived life on the optimistic side. Never once did we stop to think that errors might be occurring. We are programmers and we are great at what we do. Why would we think that we should ever worry about error handling? Oh, the users that use our application. Who cares? They should know how to enter valid data when prompted. When we say that they should enter their age, clearly we mean that this should be a number (integer) and not a string. If they
Tag: PHP Errors
PHP errors signal code hiccups that need attention Before we start looking at ways to handle errors in PHP, I wanted to touch on a few topics that beginner programmers tend to get confused. Bugs are normally errors in code that the programmer coded, that produce a result, and that result is not correct. For example, let’s say that we were creating a power function. If we sent two arguments to the power function, like 2 and 3, we might expect that the power function will raise 2 to the power of 3. If you get 8, the function performed