Re: Symbols used in classes.



..oO(Gerry)

Probably an old quesion, but im pretty new to php, and have not had
great success in searching.

Ive looking over some code which contains the following terms

$this

Refers to the current object, which invoked the method you're in.

->

Used to access non-static members (methods and properties) of an object,
e.g.

$foo = new TFoo();
$foo->somePublicMethod();

(Inside the method somePublicMethod() $this would refer to $foo as the
object that called the method.)

::

Scope resolution operator, used mainly to access static members of a
class, e.g.

TBar::someClassMethod();
print TBar::SOME_CLASS_CONSTANT;

Micha
.



Relevant Pages