PHP » Operators » ->

Syntax:
object->property
object->method()
object
An object.
property
A property of the object.
method
A method of the object.

References an object.

This operator is used to reference methods and properties in objects.

Examples

Code:
class MyClass
{
   var $s = "Hello World";

    function getProperty() {
        return $this->s;
    }
}

$myObject = new MyClass;

print $myObject->getProperty() . "<br>";
print $myObject->s;

?>
Output:
Hello World
Hello World
Explanation:

An object of a class is instantiated and referenced.