Re: Inheritance and a class function: on what class was it called?
| From: | Rasmus Lerdorf | Date: | Wed, 02 Oct 2002 22:08:45 +0000 |
| Subject: | Re: Inheritance and a class function: on what class was it called? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-118665@lists.php.net to get a copy of this message | ||
> The mistake is mine not yours. I know about the :: operator I use it all the
> time (but within classes parent::function() etc) - but I never realised
> until now that PHP will let you use any class before instantiation (and
> nearly all my PHP work uses classes). I have never even attempted to try it
> because in all other languages I know trying to use an ordinary class before
> instantiation will just result in a null pointer error or the equivalent of
> one.
>
> PHP OOP is different I know, one big example is that there is no provision
> for data encapsulation - one of the main objectives of OOP, neither can you
> differentiate between types of classes/methods (which is probably what is
> causing the confusion).
>
> Now it seems it is even more different than I thought. All I can say is
> mmhh.......
Most OO languages allow static method calls. C++, Java, Python, Ruby,
etc. PHP may have some OO differences, but this is not one of them.
-Rasmus