Possible Duplicates:
In, PHP, what is the “->” operator called and how do you say it when reading code out loud?
I use it all the time, it's impossible to search for. What is the technical name for it?
like $object->property
UPDATE: I see now that someone asked this question before, but when you search for something like "php ->" you don't get good results.
The object operator, -> , is used in object scope to access methods and properties of an object. It's meaning is to say that what is on the right of the operator is a member of the object instantiated into the variable on the left side of the operator.
What is -> in PHP? This is referred to as the object operator, or sometimes the single arrow operator. It is an access operator used for access/call methods and properties in a PHP object in Object-Oriented Programming (OOP).
The clone keyword is used to create a copy of an object. If any of the properties was a reference to another variable or object, then only the reference is copied. Objects are always passed by reference, so if the original object has another object in its properties, the copy will point to the same object.
An object copy is created by using the clone keyword (which calls the object's __clone() method if possible).
Simply enough, it's called the arrow operator
ETA:
As others have mentioned, the documentation also calls this token the "object operator". So, the docs aren't entirely self consistent, which I suppose is true of any real world documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With