On the Toptal.com site a new article has been published from author Ilya Sanosyan with his list of top ten development mistakes he sees PHP developers make leading to more buggy code.
PHP makes it relatively easy to build a web-based system, which is much of the reason for its popularity. But its ease of use notwithstanding, PHP has evolved into quite a sophisticated language with many frameworks, nuances, and subtleties that can bite developers, leading to hours of hair-pulling debugging. This article highlights ten of the more common mistakes that PHP developers need to beware of.
Included in his list are common issues like:
- Leaving dangling array references after foreach loops
- Confusion about returning by reference vs. by value
- Performing queries in a loop
- Assuming $_POST will always contain your POST data
- Ignoring coding standards
For each item on his list he provides good code examples and explanation of both why it's an issue and what can be done to prevent it.