*** Welcome to piglix ***

Scope resolution operator


In computer programming, scope is an enclosing context where values and expressions are associated. The scope resolution operator helps to identify and specify the context to which an identifier refers, particularly by specifying a namespace. The specific uses vary across different programming languages with the notions of scoping. In many languages the scope resolution operator is written "::".

In some languages, notably those influenced by Modula-3, including Python and Go, modules are objects, and scope resolution within modules is a special case of usual object member access, so the usual method operator . is used for scope resolution. Other languages, notably C++ and Ruby, feature both scope resolution and method access, which interact in various ways; see examples below.

In PHP, the scope resolution operator is also called Paamayim Nekudotayim (Hebrew: פעמיים נקודתיים‎‎, pronounced [paʔaˈmajim nəkudaˈtajim]), which means “twice colon” in Hebrew.

The name "Paamayim Nekudotayim" was introduced in the Israeli-developedZend Engine 0.5 used in PHP 3. Although it has been confusing too many developers who do not speak Hebrew, it is still being used in PHP 7, as in this sample error message:

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:

As of PHP 5.4, error messages concerning the scope resolution operator still include this name, but have clarified its meaning somewhat:

There are other less obvious ways to trigger the error, for example by attempting to use the following invalid PHP expression:

In Ruby, scope resolution can be specified using namespaces (such as classes or modules).


...
Wikipedia

...