[A] good example of a PHP “quirk” is the way PHP handles constants. It was one of the major factors affecting performance. Just removing all the constants allowed us to improve the performance by almost 2x[.]
This is a problem I have a hard time figuring out how to react to. To paraphrase DHH:
It’s more important to save developer brain cycles than CPU cycles. (I really couldn’t find the original source.)
While substituting variables with constants is easy, it seems wrong, and things that seem wrong are often illogical, and a bad idea to have in a computer program.
(For the record, I’m not saying PHP is a language that’s any good at saving developer brain cycles, but, as Marco says, you can write bad software in any language. PHP just makes it easy to write web software, period. Thus, much bad software is written in PHP.)