Paamayim Nekudotayim
The Scope Resolution Operator (scope resolution operator) of the scripting language PHP is for historical reasons Paamayim Nekudotayim ( Hebrew פעמיים נקודתיים[ paʔamajim nəkudotajim ]) and consists of two colons ( : :) placed one behind the other .
That translates and transcribes roughly “twice colon ”. Nekudotayim (colon) is made up of nekuda ( full stop , plural nekudot ) and the plural ending -ayim . The word Paamayim consists of Paam ( multiply ) and again the ending -ayim .
Using the operator allows you to access constants , static variables or static methods of a class .
example
<?php
// Definition der Klasse 'Mathe'
class Mathe {
const PI = 3.141592653589;
}
// Ausgabe von PI ohne eine Instanz der Klasse einzurichten
echo Mathe::PI;
?>
The example defines a new class with the name “Maths” and the constant “PI” which stores the approximate value for the circle number π . Then the constant is accessed outside of the class using the validity operator and output with echo without first creating an instance of the class.
origin
The Zend Engine , the PHP interpreter that is used from version 3.0 to run the PHP programming language, was programmed by the Israeli developers Andi Gutmans and Zeev Zuraski .
Web links
- Chapter dealing with Paamayim Nekudotayim in the PHP manual
- Explanation of the Paamayim Nekudotayim operator in the phpbar wiki
- Colon in Hebrew Wikipedia