December 28, 2006

Expecting T_PAAMAYIM_NEKUDOTAYIM

I wrote a previous entry about “unexpected T_PAAMAYIM_NEKUDOTAYIM,” but today, I hit the inverse, “Expecting T_PAAMAYIM_NEKUDOTAYIM.” Again, I will keep this short.

Certain functions that expect variables such as “isset” followed by a non-string, non-integer word will cause this error. For example:

isset(where_is_the_dollar_sign);

Filed under: PHP — Michi @ 10:03 pm

Share this

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Reddit
  • StumbleUpon
  • del.icio.us
  • description
  • Technorati
  • Slashdot
  • co.mments
  • NewsVine

Related

Ever get a PHP warning about this? There's plenty of long winded explanations for what the hell this error means, so I won't elaborate on why it's called what it is. It means you have an unexpected double colon (::)...
Check it out, the iPhone will support YouTube. Or maybe it's the other way around? The iPhone was getting a lot of heat earlier this month when people realized it doesn't support Flash. In fact, if that's news...

5 Comments »

TrackBack URI | Blog RSS | Comment RSS

  1. Now why would isset(where_is_the_dollar_sign); cause the PHP interpreter to expect a double-colon? Wouldn’t it be expecting a dollar sign?

    Could you possibly elaborate on why this error happens in this case?

    Comment by Stwong — February 22, 2007 @ 11:15 pm

  2. Honestly, your guess is as good as mine. After all, it’s a parse error. Anything could be happening! :P

    Comment by Michi — February 23, 2007 @ 11:18 am

  3. It’s also caused if you do a foreach($arr as $key=>ohshitiforgotthedollar) … in case anybody gets this error and this comes up near the top…

    Comment by dave — June 26, 2007 @ 5:34 am

  4. I get this same strange error and wonder if it’s related to this line of code,
    which happens about 10 lines before the line of code being blamed:

    if (!isset($_POST['sessDate'])) {

    It relates to a form’s input field
    defined in another page as

    Anybody know?

    Comment by Meir — February 11, 2008 @ 7:31 am

  5. The code you have posted is 100% valid (assuming those are single quotes and not ticks)

    Comment by Michi — February 13, 2008 @ 12:00 am

What do you think?