Home > Archive > 2008 > November

Not-so-advanced PHP tips

By Marc Ermshaus on Wednesday, November 19, 2008 at 1:35 pm.

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.

Add new comment

Name*:

Please leave the following field empty:

E-Mail:

Website:

Message*:

Please use HTML for formatting. Allowed tags:
<a href="">, <blockquote cite="">, <em>, <ul>, <ol>, <li>, <pre>, <strong>, <![CDATA[ … ]]>

<p> tags will be added automatically.

All comments are published under the CC BY-SA license.