[PHP] Operator for functions
- Date: Mon, 19 Dec 2016 12:22:04 -0800
- From: Sam Hobbs <Sam@xxxxxxxxxxxxxxxxxx>
- Subject: [PHP] Operator for functions
What is the "->" operator for functions called?
At the bottom of PHP: Operators - Manual
(http://php.net/manual/en/language.operators.php) is the note:
"The -> operator, not listed above, is called "object operator"
It has been down-voted 81 times. Is that because the operator is not
called the "object operator"? Or is it because the note says that the
operator is not listed?
I apologize if my criticism is not appropriate, but the operator is not
properly documented. The "->" operator should be listed among the other
PHP operators and there should be documentation of it.
The C++ standard calls the "." and "->" operators the "dot" and "arrow"
operators, correspondingly. For example, see "5.2.4 Pseudo destructor
That is the latest draft of the newest C++ standard.
PHP can call its "->" operator whatever the designers decide, but there
should be a definition to eliminate the confusion of different names
depending on personal preference. A book I am reading calls the operator
the "arrow operator". Is it called the object operator (as implied by
the tag) or the arrow operator or something else?