That can only explain so much. While I have been never met the guy who wrote the original block, during my tenure I've been told many, many stories about the bad personal behavior and interpersonal skills the guy had. Now admittedly I've heard only one side of the story, but I've come across evidence in the code itself.
For example, finding the guys test variables is easy - he uses select four letter vulgarities to test. Then he leaves them in the code and on one spot it was being echoed out to the screen.
There are no comments in the code base at all with the rare case of a // end foreach comment which of course gives me information that would have been obvious to both me and him if he'd indented properly.
Of the stories I've been told the most outlandish was the one about the testing of printing functionality. You see, unlike most PHP programs this one needs to address a printer directly which is connected to the server (we have one shared office printer that all the client machines and the server are pooled to). To create the claim forms the PHP postscript library is used.
When I got there the documents looked utterly terrible. Nothing was aligned - check X's weren't aligned to their boxes but most importantly much of the information was still flat out wrong. This after the guy had went through NINE CASES of paper, 2 printers, 5 toner cartridges and a shredding machine (the documents must be shredded after tests because they hold patient information).
That's right - he printed every single test and after 6 months of work had still failed to get it right. The code block he had concocted had only one real use to me - it was a live example of the postscript functions I'd never used. Rather than rewrite his block I wrote a class to handle the output.
The very first thing I did though was find the line where the system statement fired up the printer. During testing I commented out that line and wrote the 4 lines of code necessary to send the postscript file to the browser along with the correct headers - then went online to find and download a plugin for Acrobat to open and view the things.
I then wrote the functionality required in 3 days and used 5 sheets of paper for final tests. It's very hard to respect a guy needing 6 months to do the same task while wasting around a couple hundred dollars in paper and still failing to get the project to work.
The worst part though is about the month after I started the guy went to a client of the company to brag how some of the errors in the software where put there intentionally. When I heard this I lost what little sympathy I had for the guy.