ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

A Haystack in a Needle

February 04, 2008 4:50pm

Subscribe [3]
  • #1 / Feb 04, 2008 4:50pm

    Derek Jones

    7561 posts

    Have you ever done that before?  Looked for a haystack in a needle?  It’s quite difficult, as one might imagine, as typically you do not find large haystacks within tiny needles.  One might say it was a waste of time, and indeed one would be right.

    PHP is picky about its grammar and when you might want to say, “PHP, is this needle in this haystack?” PHP would prefer that you ask “PHP, in this haystack, can this needle be found?”  This often is the source of much frustration and wasted time for PHP developers, because PHP is not internally consistent with the order of arguments when you want to search for a needle in a haystack.  So if you don’t pay close attention to the order of your arguments, it’s quite easy to find yourself in a situation where you’re asking “PHP, in this needle, can this haystack be found?”  When you make this mistake with string functions, you won’t get an error, your script will just not do what you intend for it to do, and on a complex application it’s easy to start the debug process and not realize that that was the error for many minutes.

    Continue reading…

  • #2 / Feb 04, 2008 6:25pm

    Derek Allard

    3168 posts

    For the record “bit by this” in my case today was documented by the following instant message to Derek.

    “I just lost 18 minutes because I had my strpos() arguments in the wrong order”
    “FRAAAAAGGGHHHHH!”

  • #3 / Feb 04, 2008 9:34pm

    John Fuller

    779 posts

    Somehow I feel like I got ripped off on that PDF and PNG.  Can I have my money back?  😉

  • #4 / Feb 04, 2008 9:43pm

    Derek Jones

    7561 posts

    Indeed, it’s less impressive once the individual function list for each becomes unnecessary.  Maybe it would just be simpler to have an optic surgeon lightly burn the image into my retinas so I can see it as a shadow over everything.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases