Appendix A. The Bad Parts

PHP having bad parts is difficult to comprehend. After all, it is one of the most widely used software development languages in the world. NASA, Wikipedia, Yahoo!, and IBM, among others, all use it day in and day out for their critical data processing and web development. In fact, it has been my opinion that PHP does not have any really bad parts, just some potentially tricky areas to be aware of and work around.

However, after some deep soul searching, I came to realize that PHP is not perfect—how could it be? It was created by humans (imperfect beings) and newer versions are being produced all the time (with bug fixes included). Having said that, we will spend the few remaining pages looking at the weaknesses (or perceived weaknesses) of PHP, as well as ways to either work around them or avoid them altogether.


The first item to discuss here is the inclusion of a goto statement in PHP version 5.3. This is one of those items that, in my opinion, should only be used by those with enough experience to not get themselves trapped in an infinite loop. As you may recall from Chapter 10, there are a number of potential coding follies that you can get yourself into. Nothing truly safeguards you against writing code similar to that shown in the following listing:

goto landing15;


Actually, PHP has an .ini setting directive that will stop a script that runs too long with a default setting of 30 seconds—it’s called max_execution_time. If the time limit ...

Get PHP: The Good Parts now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.