Date: 06/26/00
- Next message: Bug Database: "[PHP-DEV] PHP 4.0 Bug #5180 Updated: Simple SELECT query fails to return values"
- Previous message: Bug Database: "[PHP-DEV] PHP 4.0 Bug #4858 Updated: php core dump"
- In reply to: Stanislav Malyshev: "Re: [PHP-DEV] "::" meaning and documentation"
- Next in thread: Stanislav Malyshev: "Re: [PHP-DEV] "::" meaning and documentation"
- Reply: Stanislav Malyshev: "Re: [PHP-DEV] "::" meaning and documentation"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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>
- Next message: Bug Database: "[PHP-DEV] PHP 4.0 Bug #5180 Updated: Simple SELECT query fails to return values"
- Previous message: Bug Database: "[PHP-DEV] PHP 4.0 Bug #4858 Updated: php core dump"
- In reply to: Stanislav Malyshev: "Re: [PHP-DEV] "::" meaning and documentation"
- Next in thread: Stanislav Malyshev: "Re: [PHP-DEV] "::" meaning and documentation"
- Reply: Stanislav Malyshev: "Re: [PHP-DEV] "::" meaning and documentation"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

