Home

Not-so-advanced PHP tips

Published on 19 Nov 2008. Tagged with programming, php, rants.

Smashing Magazine has published an article featuring (what they call) "advanced PHP tips". Half of the described techniques can be considered bad style or pure and utter nonsense in any programming language (#3, #4, #6, #9, #10).

Then there is this bit from #5:

If you're using regular expressions, then ereg_replace() and preg_replace() will be much faster than str_replace().

That is comparing apples and oranges. If you are using regular expressions, str_replace() will not even be an option because the function cannot handle regular expressions.

The article is a bad piece of advice but a good example why reading comments can be useful.