Re: "::" meaning and documentation
| From: | Ulf Wendel | Date: | Mon, 26 Jun 2000 16:23:17 +0000 |
| Subject: | Re: "::" meaning and documentation | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-22362@lists.php.net to get a copy of this message | ||
Stanislav Malyshev wrote:
> UW>> Does it officially introduce static method calls or is this a side
> UW>> effect? If so, I would like to see some documentation on it and how can
> UW>> a static class use the pseudo object $this to access it's properties
> UW>> (but not it's methods)?
>
> It can't. $this is empty if called via this method.
That's what I would expect, but why does the snippet work? $this gets
generated on the fly by some magic I don't understand.
class foo {
var $bar = 0;
function do() {
var_dump($this);
$this->bar = 3;
var_dump($this);
print $this->bar;
}
}
foo::do();
If "::" introduces static calls what's the syntax to access properties
and methods of foo from within do() ? Of course this can't be done using
the pseudo object $this .
Ulf