PHP expects T_PAAMAYIM_NEKUDOTAYIM?

Viewed 177531

Does anyone have a T_PAAMAYIM_NEKUDOTAYIM?

11 Answers

It’s a name for the :: operator in PHP. It literally means "double colon". For some reason they named it in Hebrew. Check your code syntax, and put a :: where appropriate :-)

I know Hebrew pretty well, so to clarify the name "Paamayim Nekudotayim" for you, the paraphrased meaning is "double colon", but translated literally:

  • "Paamayim" means "two" or "twice"
  • "Nekudotayim" means "dots" (lit. "holes")
    • In the Hebrew language, a nekuda means a dot.
    • The plural is nekudot, i.e, dots, which function as vowels
    • The reason it why it's called Nekudo-tayim is because the suffix "-ayim" also means "two" or "twice", thus :: denotes "two times, two dots", or more commonly known as the Scope Resolution Operator.

Edit: Unfortunately, as of PHP 8.0, the answer is not "No, not anymore". This RFC was not accepted as I hoped, proposing to change T_PAAMAYIM_NEKUDOTAYIM to T_DOUBLE_COLON; but it was declined.

Note: I keep this answer for historical purposes. Actually, because of the creation of the RFC and the votes ratio at some point, I created this answer. Also, I keep this for hoping it to be accepted in the near future.

This can happen on foreachs when using:

foreach( $array as $key = $value )

instead of

foreach( $array as $key => $value )

This just happened to me in a string assignment using double quotes. I was missing a closing curly on a POST variable...

"for {$_POST['txtName'] on $date";

should have been

"for {$_POST['txtName']} on $date";

I can't explain why. I mean, I see the error that would break the code but I don't see why it references a class error.

This just happened to me in a foreach loop. I had inadvertently typed ($array as $key as $value) and PHP objected to the first as.

Related