Posted by Christoph Burschka on 11/14/06 08:50
Blackhawk@idonthaveone.com schrieb:
> Can someone help me please
>
> I have been playing with PHP for some time but I never ran across code
> like this.
>
> function addGuestBookEntry() {
> $entry = $this->_createEntryHTML();
> if (!$entry) return false;
> $this->data = $entry.$this->data;
> return $this->_writeDataFile();
>
> what is the " ->" doing in the sample above?
> Is that a form of piping the data?
$a->b indicates that b is a member of object a. It's the PHP equivalent
of "." in Java.
In PHP, all object members must be referred to with their parent object,
even inside their own functions. That would be $this->function() or
$this->variable.
(Note that "->" is only used for objects. Static members of a class are
referred to with ClassName::member)
Navigation:
[Reply to this message]
|