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);

Be Sociable, Share!
    • http://stwong.net/ Stwong

      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?

    • http://www.michikono.com Michi

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

    • dave

      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…

    • Meir

      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?

    • http://www.michikono.com Michi

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

    • Najrellim

      And so ??????????? The solution to the error is ???????