About the Author

Chris Shiflett

Hi, I'm Chris, a web developer and a founding member of Analog. I live and work in Brooklyn, NY.


Smashing PHP

We're trying to do something special at OmniTI. We've got great web talent, from operations to design (and plenty of everything in between). For my part, I bridge the gaps as much as I can, so I try to keep my finger on the pulse of many different web disciplines. This is partly why I've been reading Smashing Magazine since sometime last year.

I was pleased to see them branch out slightly and publish an article on PHP entitled 10 Advanced PHP Tips to Improve Your Programming. Some people read articles self-described as advanced just to be able to claim they're not advanced, but I can appreciate a good article, even one that reeks a bit of self-importance. Smashing Magazine had established a pretty good reputation for quality by this time, so I read with great interest.

I was disappointed.

I was so disappointed that I wanted to do something about it, but with fewer than 5,000 subscribers at shiflett.org, I couldn't hope to reach the same audience as Smashing Magazine with more than 100,000 subscribers. The only way to help stop the spread of misinformation is to publish to the same audience, so I offered to write a rebuttal:

@smashingmag: I love your site, but the recent article on PHP tips is well below your standards. Would you entertain a rebuttal?

Likely due to a prod from Jon, Vitaly (the editor in chief) responded positively:

@shiflett Chris, would you like to write an article on the shortcomings of this article and suggest some more useful tips and tricks?

Because Sean and I were in the middle of dissecting the flaws in the article, I roped him into helping me write the rebuttal. The result, 10 Useful PHP Tips Revisited, was published just a short while ago:

http://smashingmagazine.com/2009/03/24/10-useful-php-tips-revisited

If you use Twitter, Sean and I would greatly appreciate your help in spreading the news:

Please help us share: The PHP article/rebuttal that @coates and I wrote for @smashingmag is published: http://tr.im/phptips

Thanks very much for your help, feedback, and support. I hope you like the article. :-)

About This Post

Smashing PHP was posted on Tue, 24 Mar 2009 at 17:55:38 GMT.

12 Comments

1. Dmitri's GravatarDmitri said:

I always use Smashing Magazine as a source of useful links, not more. Their love to make rounded (preferably big) numbers is weird. "55 CSS technics", "30 WP themes" etc. Any proper developer should recognize the weekness of their articles. Out of 100 tips (links) they provide in some of posts only 3-5 can be useful, others - total bullshit.

IOW read them, but do not fall in love with everything they said.

My 2 cents.

Wed, 25 Mar 2009 at 00:14:28 GMT Link


2. Chris Shiflett's GravatarChris Shiflett said:

Fair points, Dmitri. I happen to like browsing through their articles, and I have only been disappointed by the article ours refutes.

We've been discussing writing more articles for Smashing Magazine, where we won't be as constrained. I'm not sure if that will raise the bar in your eyes, but I hope so. :-)

Wed, 25 Mar 2009 at 05:00:00 GMT Link


3. jcavard's Gravatarjcavard said:

I really like your work!

Wed, 25 Mar 2009 at 12:18:07 GMT Link


4. Lars's GravatarLars said:

I've just copied and pasted the text "Please help us share: The PHP article/rebuttal that @coates and I wrote for @smashingmag is published: http://tr.im/phptips" into Twitter assuming that this is what you wanted but then it occurred to me that it now sounds as if myself and Coates had written it.

My point is, in order to prevent others from doing the same, I suggest that you edit the text accordingly.

Great article btw, keep up the good work!

Wed, 25 Mar 2009 at 12:24:07 GMT Link


5. Nick's GravatarNick said:

Ha, Lars has a good point. BTW

http://tr.im/phptips now is 503 Service Unavailable

No server is available to handle this request. Please try again later.

Wed, 25 Mar 2009 at 15:28:13 GMT Link


6. Chris Shiflett's GravatarChris Shiflett said:

Good point, Lars. I thought about that, and in the end, I didn't want to talk about myself in the third person. :-)

Thanks very much for the kind feedback.

Tue, 31 Mar 2009 at 13:15:18 GMT Link


7. Andy's GravatarAndy said:

Hi, thanks for the article and the additional tip on scream.

There is a typo in the surpression operator part. Code snipped uses the &-operator (reference) instead of @-operator.

Tue, 31 Mar 2009 at 21:27:12 GMT Link


8. Chris Shiflett's GravatarChris Shiflett said:

Hi Andy,

You're right that the example is assigning by reference, but wrong that it's a mistake.

Wed, 01 Apr 2009 at 01:24:29 GMT Link


9. Andy's GravatarAndy said:

Omg, read again - now I see the whole picture. It was only a example of loosing the oversight if you add a var by reference...

Was a little bit late yesterday, sorry for the hassle.

Wed, 01 Apr 2009 at 08:02:38 GMT Link


10. Chris Shiflett's GravatarChris Shiflett said:

Not a problem. Hope you enjoyed reading the article. :-)

Wed, 01 Apr 2009 at 13:13:28 GMT Link


11. terry chay's Gravatarterry chay said:

The article you reference (original SmashingMag) article reminds me of this 10 security tips article published on a web development site I had to do a takedown of in the comments :-(

Fortunately, I remembered to exhibit more tact than is my wont in my reply.

Sun, 05 Apr 2009 at 05:57:59 GMT Link


12. AskApache's GravatarAskApache said:

Thanks for setting the record straight... I found your site through some security friends and heard about this article so I checked it out.

Smashing is actually a fantastic resource, they try awfully hard and usually have useful stuff.. but after reading that article I was pissed. As a beginner to php programming myself in many ways I only use php for WordPress Dev mostly, even I could recognize the lack of filtering they did by allowing that one in. Ughh.

So I read your rebuttal and was pleased to see a well-written explanation of what was wrong, what could be improved, and learned a few things too!

Sun, 05 Apr 2009 at 10:12:22 GMT Link


Post A Comment

Personal Details and Comment

Style Guide

Line breaks are converted to paragraphs. Also use:

  • <a href="" title="">text</a>1
  • <em>text</em>
  • <blockquote><p>text</p></blockquote>
  • <code>2  <?php  if ($foo) {      $foo = TRUE;  }  ?></code>
  1. Note: <code> can be used inline (e.g. in paragraphs) or in a block as shown. Include whitespace and newlines in blocks.

Please enter Chris (my first name) below. This is a primitive spam prevention technique, and I apologize for the inconvenience.

Preview and Submit

Upcoming Talks

ConFoo

10 - 12 Mar 2010

At Hilton Montréal Bonaventure, Montréal, Canada.

South by Southwest

12 - 16 Mar 2010

At Austin Convention Center, Austin, Texas.

Dutch PHP Conference

10 - 12 Jun 2010

At TBD, Amsterdam, Netherlands.

O'Reilly Open Source Convention

19 - 23 Jul 2010

At Oregon Convention Center, Portland, Oregon.

New Comments

Niall Kelly wrote:

Having tried other methods without success and looked through plenty of bloated documentation, th...

Posted in Git on Snow Leopard
liukang wrote:

I have problem with this example. In my php.ini magic_quotes_gpc is off so i'm using only addsla...

Posted in addslashes() Versus mysql_real_escape_string()
RyanTheGreat wrote:

Well, I'm not Chris, but I will do my best to address the questions raised in the comments by Ian...

Posted in Security Corner: Cross-Site Request Forgeries
Chris Shiflett wrote:

Thanks for the kind words, Simon. I'm glad you liked the tutorial. In case it's helpful, here'...

Posted in Webstock
Chris Shiflett wrote:

Hi Robin, I plan to post something about it, but it's going to be hard to express everything i...

Posted in Webstock

Browse Comments


Work and Books

Analog Essential PHP Security HTTP Developer's Handbook