Posted by Tony Marston on 09/03/07 15:52
"stiki" <laptopia@gmail.com> wrote in message
news:1188582269.180135.221550@q4g2000prc.googlegroups.com...
> How and what does this mean in php: ($this->varname)
>
> I can't seem to find this by searching Google, because the "->" are
> removed from my search query.
>
> Cheers,
> Igor Terzic
> www.stikimedia.com
>
$this->varname refers to a class variable (property) which is available to
any function (method) within that class. This is not to be confused with
$varame which refers to a variable whose scope is limited to the current
method.
$this->function() refers to another function (method) within the same class,
as opposed to function() without $this->) which refers to a non-class method
which exists in global scope.
Basically $this-> is used within a class method to refer to something else
which exists within the same class.
--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
Navigation:
[Reply to this message]
|