Date: 01/18/01
- Next message: kumar <email protected>: "[PHP-DEV] PHP 4.0 Bug #8788: unable to install php module for apache"
- Previous message: Cynic: "RE: [PHP-DEV] More OOP"
- In reply to: Thomas Watson: "Re: [PHP-DEV] More OOP"
- Next in thread: Cynic: "RE: [PHP-DEV] More OOP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi Tom,
>I looked at your link "http://www.mm4.de/php4win/tips.php3?id=1" and found
>that "parent::classname()" worked. But how? Usualy PHP uses a "->" like
>"$this->classname()". I've never before seen the two "::" - Can someone
>explain?
This syntax is borrowed from C++ (or Java) and is a way to access methods
of classes which have no instance. This is also called a static method.
So if you have
class myclass
{
function myfunction()
{
...
}
}
you can access this function via "myclass::myfunction()", even if there is
no object instantiated. "parent" is a reserved word to access functions of
the superclass.
(I hope I got everything right ;-)
Regards
Alex
-- | Alexander Wirtz | eMail: wirtz <email protected> | | web <email protected> GmbH | WWW: http://www.web-active.com |-- 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: kumar <email protected>: "[PHP-DEV] PHP 4.0 Bug #8788: unable to install php module for apache"
- Previous message: Cynic: "RE: [PHP-DEV] More OOP"
- In reply to: Thomas Watson: "Re: [PHP-DEV] More OOP"
- Next in thread: Cynic: "RE: [PHP-DEV] More OOP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

