Re: [PHP-DEV] "::" meaning and documentation From: Ulf Wendel (ulf <email protected>)
Date: 06/26/00

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

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>