Does anyone have a T_PAAMAYIM_NEKUDOTAYIM
?

- 45,213
- 22
- 199
- 169

- 11,199
- 10
- 68
- 109
-
26Sometimes this is PHP's way to tell you you are missing a $ sign... for example if you write _SESSION["foo"] instead of $_SESSION["foo"] – Gonzo Jan 10 '12 at 10:28
-
I know this is an old question, but the short answer is that PHP is (mis-)interpreting a constant as a class name. Some operations, such as `empty`, won’t evaluate expressions which include constants. Therefore they will try to interpret a constant as a class name and expect it to have a `::` to indicate a static property. And, of course, if you forget the `$` on a variable, it is mis-interpreted as a constant. Much of this madness, if not the error message, is fixed in later versions of PHP. – Manngo Oct 20 '16 at 20:55
11 Answers
It’s the double colon operator ::
(see list of parser tokens).

- 164
- 1
- 11

- 643,351
- 109
- 780
- 844
-
11
-
3No. I just added an evaluation that returns the same T_PAAMAYIM_NEKUDOTAYIM. I found it by mistake. – machineaddict Jun 11 '14 at 06:23
-
It shows when $ is missing from variable. I got it today and reached this post. In a foreach($cats as cat) then use the same cat in next line shows the error. But the answer says about :: and the person accepted it....?? – Web_Developer Jul 09 '15 at 15:43
-
8@Web_Developer, the reason that happens is because if you have a `foreach($cats as cat` the only acceptable character after the `cat` for a syntactically valid statement is a `::`, as it would allow you to specify a static property of some class called `cat`. Eg, if `cat` class has a public static member called `$mouse`, then `foreach($cats as cat::$mouse)` is perfectly valid `php`, but a statement with anything other than `::` after the `cat` would be a syntax error. If `$mouse` were not a declared property of `cat` you would get a fatal error, but still not a syntax error. – chiliNUT Jan 21 '16 at 02:56
-
For me, it was because I had (my own personal code example of the error) `$tokenStatus = $tokenSystem->SecurityAuthenticationTokens::CheckAuthenticationToken($data['hashedPLToken']);` I should NOT have had the :: (static) in there mixed with the -> operator since it was an instantiated class. My fix was... `$tokenStatus = $tokenSystem->CheckAuthenticationToken($data['hashedPLToken']);` – PerryCS Sep 13 '16 at 06:06
-
5
It's Hebrew for "double colon".

- 239,200
- 50
- 490
- 574

- 3,939
- 7
- 41
- 54
-
93PHP - the only language where you can add an error message in Hebrew only and people accept your commit. – Matti Virkkunen Feb 16 '15 at 15:05
-
33
-
1
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 :-)

- 30,738
- 21
- 105
- 131

- 9,834
- 4
- 27
- 31
-
1Functions are in English, but that error is in Hebrew. I'm not sure if any other errors are in Hebrew though. – alex Mar 01 '09 at 00:11
-
31Highlight string is להדגיש מחרוזת. From now on, I will only use my custom array_push function לדחוף_מערך in Hebrew characters, of course. I'm sure all of my non-Hebrew speaking coworkers will love it. Just about all of our dev team speaks at least one language written in non-latin characters. Should be fun :) – Isaac Nov 21 '13 at 22:05
-
1@Ilya Birman It does not literally mean "double colon"; it literally means "two times, double dots" – Sapphire_Brick Dec 10 '19 at 03:26
-
@Sapphire_Brick Well yes, but actually no. ;) The word in Hebrew for "colon" (the character, not the organ) IS "nekudotayim", which literally does mean "double dots". So it's 100% correct to translate the Hebrew term as either "double double dots" or "double colon". – Sandwich Jun 23 '22 at 07:48
From Wikipedia:
In PHP, the scope resolution operator is also called Paamayim Nekudotayim (Hebrew: פעמיים נקודתיים), which means “double colon” in Hebrew.
The name "Paamayim Nekudotayim" was introduced in the Israeli-developed Zend Engine 0.5 used in PHP 3. Although it has been confusing to many developers who do not speak Hebrew, it is still being used in PHP 5, as in this sample error message:
$ php -r :: Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM
As of PHP 5.4, error messages concerning the scope resolution operator still include this name, but have clarified its meaning somewhat:
$ php -r :: Parse error: syntax error, unexpected '::' (T_PAAMAYIM_NEKUDOTAYIM)
From the official PHP documentation:
The Scope Resolution Operator (also called Paamayim Nekudotayim) or in simpler terms, the double colon, is a token that allows access to static, constant, and overridden properties or methods of a class.
When referencing these items from outside the class definition, use the name of the class.
As of PHP 5.3.0, it's possible to reference the class using a variable. The variable's value can not be a keyword (e.g. self, parent and static).
Paamayim Nekudotayim would, at first, seem like a strange choice for naming a double-colon. However, while writing the Zend Engine 0.5 (which powers PHP 3), that's what the Zend team decided to call it. It actually does mean double-colon - in Hebrew!

- 45,213
- 22
- 199
- 169
-
2It's actually colloquial Hebrew. Wikipedia now says: "In PHP, the scope resolution operator is also called Paamayim Nekudotayim (Hebrew: פעמיים נקודותיים, pronounced [paʔaˈmajim nəkudoˈtajim], the second word a colloquial corruption of נקודתיים, pronounced [nəkudaˈtajim]), which means “double colon” in Hebrew." – mic Aug 07 '19 at 18:40
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.

- 1,560
- 12
- 26
-
1What do you mean by "dots that act like vowels do in English"? The "Nekudot" here represent the two dots that a colon (:) is a compound of. Are you referring to [Niqqud](https://en.wikipedia.org/wiki/Niqqud)? This concept is not related, even though both words have the same root. – Michael Haddad May 08 '21 at 22:24
-
1Also, The "-ayim" suffix means *twice*, "Paam" means *time*. So "Paamayim" means *two times* or *twice*. "Nekuda" is *a dot*, and "Nekudot" is the plural of "Nekuda" - *many dots*. Here again, the "-ayim" suffix means "twice". So we get: *Twice many dots twice* - doesn't make much sense... The reason is that "Nekudotaym" is actually the **wrong** spelling and pronunciation of the word. It's a mistake made by the PHP developers. It should be "Nekud**a**tayim" - meaning, *twice a "Nekuda"* or *two dots*. So it actually means: *Twice two dots*, which make much more sense. – Michael Haddad May 08 '21 at 22:25
-
@Sipo I was trying to avoid explaining the technical details. _Nekudot_ (נקודות) are vowels. Regarding your second point, the typo in the word is another unrelated issue with the error message. – Sapphire_Brick May 10 '21 at 04:26
-
@Sipo Why not? Do you mean the fact that _nekudot_ can be omitted, despite the risk of ambiguity? – Sapphire_Brick May 11 '21 at 00:26
-
No. I mean that vowels in Hebrew have another name: *Tnu'ot*, and they are visually repesnted by graphic symbols called *Niqqud*, not *Nekudot*. Although both words come from *Nekuda*, they are not the same. A double colon has nothing to do with vowels. – Michael Haddad May 11 '21 at 02:53
-
It purely sounds like Tamil language.. As mentioned.. "Paamayim" means "two" or "twice" - Panmai means plural in Tamil "Nekudotayim" means "dots" (lit. "holes") - Ottai means hole in Tamil 'yim' we usually use to conjoint next word.. – Mithun Jack Jun 20 '22 at 15:39
This is also coming when you apply a constant in PHP to the empty() function:
if (!empty(SOME_CONSTANT)) {
}
That was my case. I solved it by using this:
$string = SOME_CONSTANT;
if (!empty($string)) {
}

- 30,738
- 21
- 105
- 131

- 539
- 5
- 16
-
2
-
1Nice Question : This is just for example if some else got in this error situation , i just show it will be also possible :) – Harman Nov 22 '14 at 04:54
-
7@Don't Panic: Why not? empty() not only tests if a variable exists, but also if it's value is "empty" (in case of PHP a zero (0) is also empty). Such a constant could represent a value which is meant to be changed by a user - like DB settings or some true / false values and other value types which the code developer don't know at design-time. This is common for APIs or code frameworks. I just don't understand why the developers of the Zend parser didn't used a common word that everybody knows and understands but instead some hebrew words. I mean, it's not even really funny or so. – StanE Mar 06 '15 at 01:07
-
1I use constants in config files, and I want to know in code if a specific constant is empty (null, false, 0, empty string, emty array....). Should I test against all of them manually ? WTF – qdev Apr 26 '19 at 11:58
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.

- 3,728
- 2
- 33
- 40
This can happen on foreachs when using:
foreach( $array as $key = $value )
instead of
foreach( $array as $key => $value )

- 2,872
- 1
- 24
- 44
-
This only happens in PHP 7.0, and is no longer the case as of PHP 8.0: https://3v4l.org/HScA4 – MAChitgarha Jan 19 '23 at 07:01
For me this happened within a class function.
In PHP 5.3 and above $this::$defaults
worked fine; when I swapped the code into a server that for whatever reason had a lower version number it threw this error.
The solution, in my case, was to use the keyword self
instead of $this
:
self::$defaults
works just fine.

- 12,550
- 7
- 67
- 96
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.

- 11
- 3
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
.

- 682
- 8
- 17

- 115
- 1