Re: OOP and Future of PHP
| From: | Ulf Wendel | Date: | Thu, 26 Apr 2001 06:24:12 +0000 |
| Subject: | Re: OOP and Future of PHP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-50427@lists.php.net to get a copy of this message | ||
Rasmus Lerdorf schrieb:
> > If anyone has any idea, or tricks to hide information in a variables or
> > method in a class, or in other words, make a variable or method a private,
> > I would really like to know. Thanks for any comments.
>
> PHP also doesn't have introspection, so there isn't a good way for people
> to see what is in your API so a bit of obscurity should hide things for
> you.
Hmm, the old, dirty hack print_r($obj). And the new functions:
http://www.php.net/manual/en/function.get-class.php
http://www.php.net/manual/en/function.get-class-vars.php
http://www.php.net/manual/en/function.get-object-vars.php
http://www.php.net/manual/en/function.get-class-methods.php
...
I'd call these not only debugging function but functions that can be
used for introspection.
Anyway, people should not use parts of the API your documentation does
not mention as public. Whoever does so, should reread the book on OOP.
Yes, it could be better, but think of the zillions of PHP scripts that
will break and all the beginners - PHP is quite often a beginners
language - will ask you, Reuben, for support ;).
Ulf
--
Neu: PEAR Cache Erweiterung OutputCompression
http://www.ulf-wendel.de/php/show_source.php?file=out_cache_com
http://www.phpdoc.de