tags:

views:

85

answers:

4
+2  A: 

It's for classes.

See here:

http://de.php.net/manual/en/language.oop5.basic.php

JochenJung
More specifically: it's for class *instances*.
strager
+4  A: 

The -> is used with object methods/properties, example:

class foo{
  function bar(){
    echo 'Hello World';
  }
}

$obj = new foo;
$obj->bar(); // Hello World

More Info:

Sarfraz
+1  A: 

-> operator access properties and methods of an object.

Probably you should read PHP OOP introduction: http://php.net/manual/en/language.oop5.php

gustavogb
+1  A: 

Expanding on sarfraz's answer to demonstrate how to access properties:

class foo{
  public $value = "test"; 
  function bar(){
     //// code
  }
}

$obj = new foo;
$obj->bar();
echo $obj->value;     //displays "test" 
Chris
would this be the same as saying bar($value)?
Murtez
No... bar($value) is not really useful without having $object=new foo(); and calling $obj-bar() which is a method, whereas $value is a member/field of the class.
Chris