How PHP taught me a couple of words in Hebrew

A typo in a WordPress plugin I was working on lead me to encounter quite an unexpected parser error:

Parse error: syntax error, unexpected ';',
expecting :: (T_PAAMAYIM_NEKUDOTAYIM)

Which obviously threw me off the track and on to research how it came up with such a surprising token.

As it turns out, Paamayim Nekudotayim is the transliteration of פעמיים נקודתיים which literally means “double colon”, in Hebrew.

T_DOUBLE_COLON, the token you would have expected PHP to use, actually does exist in the list of PHP’s parser tokens. However, it is only an alias for T_PAAMAYIM_NEKUDOTAYIM, which the parser uses.

All parser tokens are named after relevant English words (you can see the complete list at http://php.net/manual/en/tokens.php), except for this one.

Digging further, I found out that the origin lies in the previous century. While writing the Zend Engine 0.5, which powers PHP3, the Zend team decided to call the Scope Resolution Operator (or double colon, :: ) that way for some reason. It kept that name in PHP since then.

Looking this up on Google will uncover a few blog and forum posts no more interesting than this one. Most of them are basically along the lines of “wtf is T_PAAMAYIM_NEKUDOTAYIM omfgwtfbbq!?” and some of them date back more than 10 years ago.

The more you know!

Share the love!