Re: Namespaces in PHP

From: 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:
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.
Not the only reason, of course, most PEAR classes are real classes that you instantiate. Some (like Validate) are used statically as namespaces.
Chris ===== Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly
     Coming Fall 2004
HTTP Developer's Handbook - Sams
     http://httphandbook.org/
PHP Community Site
     http://phpcommunity.org/
-- paperCrane <Justin Patrin>

« previous php.general (#181738) next »