3 ms·
Yeah, except you're talking about PHP Pitfalls and failed to mention and then fell victim to and perpetuated the #1 Pitfall of PHP: Legacy Cruft. PHP's librari
by numbsafari 14y ago
Yeah, except you're talking about PHP Pitfalls and failed to mention and then fell victim to and perpetuated the #1 Pitfall of PHP: Legacy Cruft.
PHP's libraries are full of Legacy Cruft that any other sane system would have deprecated and eliminated during a major revision transition.
The wholly inefficient and unsafe legacy MySQL lib is one of the primary examples.
Good on you for at least mentioning parameterized statements, but you didn't really follow through. You then go on to confuse the situation by talking about the old API.
Instead, you should have just said "Using this old API is a horrible idea. Don't. Ignore every guide or tutorial that does."
PHP has evolved considerably from its roots. The #1 problem with PHP is that it still lives in its parent's basement and hangs out with the same losers it met in Kindergarten.
- Udo 14y agoI don't really agree with that criticism. The first DB example I used was all about parameterized queries. Still, that doesn't absolve people from at least thinking about escaping stuff, that's why this other example is in there. But I get your point, I'll append the section to make it clearer why I'm referencing a legacy library.
- valuegram 14y agoCouldn't this be seen as a "benefit" - not having to rewrite code after every major release?
- TazeTSchnitzel 14y agoYou still do. They do break things with each major release, sometimes in a big way. (Fatal-by-default errors for some types of "bad" OOP code and not setting the timezone in PHP 5.4, for example). Just not as much as some other languages.
- numbsafari 14y agoYou are more than welcome to not fix all of the security holes created by and allowed to exist by the old API. Script kiddies everywhere will "benefit".