The PHP WTF?!?

For an entertaining read from time to time (They only seem to update once or twice a week).

Check out The PHP WTF.

Funny site that highlights some of the worst PHP code you can imagine.

Todays example shows off some great code where apparently the coder didn’t realize you could pull back more than one column at a time with a sql query.

  • http://kcpug.org Daniel Holmes
    Re: The PHP WTF?!?
    If the internet had been around when I was 10; when I was hacking away at my C-64 Basic…my code most certainly would have made it onto some “c-64 WTF?!?”

    Remeber, it can be funny…but we were all there at one time: even if it was a long, long time ago and only lasted a minute or two. :-)

    • http://kcpug.org Daniel Holmes
      Re: The PHP WTF?!?
      Or worse yet…
      I wrote [url=http://thephpwtf.com/index.php?blog=1&title=i_m_smrt&more=1&c=1&tb=1&pb=1]one of these[/url] just two or three years ago when I was getting used to the mighty power of dynamic flexibility. Heck, I think that code is even still in production. /me cringes
  • http://www.poehouse.com/eric/ Eric Poe
    Re: The PHP WTF?!?
    Seeing bad code and learning why it’s bad is more helpful to me than seeing good code and not knowing what makes it good.

    I’ve been needing to do a complete rewrite of my site to get rid of some of the cruft (ok, most of it is cruft, even the content). Seeing bad code makes me want to do this even more. However, who else but me will see the bad code?

    • http://www.poehouse.com/eric/ Eric Poe
      Re: The PHP WTF?!?
      After reading this site for the past week (I have its RSS feed as a live bookmark in Firefox), I realize that I am even more of a PHP neophyte than I thought I was a week ago. This is good. Some of the PHPWTF comments have pointed me to several PHP functions and operators that I didn’t even know existed. For instance, I had never seen the “===” operator.

      And that, class, is why I’m a PHP hobbiest rather than a PHP professional.

  • Itshim
    Re: The PHP WTF?!?
    I have surfed this site before (not very recently) and I will say it is funny to see some of the things people come up with. Some times it’s simply unbelievable.

    Just a warning: some of the comments about how the code should look (or work) are not the best. They do not make you say WHF, but…