Re: Namespaces in PHP
| From: | Justin Patrin | Date: | Mon, 29 Mar 2004 22:45:01 +0000 |
| Subject: | Re: Namespaces in PHP | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-181738@lists.php.net to get a copy of this message | ||
Chris Shiflett wrote:
--- Justin Palmer <justin@cetusa.org> wrote:Not the only reason, of course, most PEAR classes are real classes that you instantiate. Some (like Validate) are used statically as namespaces.I did not think that PHP supported namespaces?It doesn't.<quote> There are lots of other things, of course. One method of learning about this would be to take every OO term (encapsulation, namespacing, etc.) and find a really good explanation of the term. </quote>Well, some people use objects as a kludge for namespacing. For example, you can have $myclass->foo() and $yourclass->foo() be two different things. Of course, the more common kludge is to use strict naming conventions instead, but this requires more discipline. I'm not sure, but I'd guess that this is one of the reasons that PEAR classes are classes.
Chris ===== Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly-- paperCrane <Justin Patrin>Coming Fall 2004HTTP Developer's Handbook - Samshttp://httphandbook.org/PHP Community Sitehttp://phpcommunity.org/