Scope Resolution Operator - PHP

PHP

In PHP, the scope resolution operator is also called Paamayim Nekudotayim (Hebrew: פעמיים נקודתיים‎, ), which means "twice colon" or "double dot twice" 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

A similar error can also occur where no scope resolution operator is present. For example, attempting to check whether a constant is empty triggers this error:

$ php -r 'define("foo", "bar"); if (empty(foo)) echo "empty";' Parse error: syntax error, unexpected ')', expecting 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)

Read more about this topic:  Scope Resolution Operator