Re: More OOP

From: Date: Thu, 18 Jan 2001 17:19:53 +0000
Subject: Re: More OOP
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-44496@lists.php.net to get a copy of this message
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@web-active.com | | web@ctive GmbH | WWW: http://www.web-active.com |

« previous php.dev (#44496) next »