Re: Namespaces in PHP 6 - ++$take
| From: | Patrick Mueller | Date: | Fri, 10 Nov 2006 21:46:20 +0000 |
| Subject: | Re: Namespaces in PHP 6 - ++$take | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-26490@lists.php.net to get a copy of this message | ||
Daniel T. Gorski wrote:
Escpecially due to the new OO features of PHP 5, namespaces are urgently required for writers of independent libraries which should not clash.I would claim exactly the opposite. That's because you already get scoping on names, for free, when you use objects. The method and field names. Of course, for static methods and fields you'll need to reference the class name again ... so don't do that :-) There would typically be a one time 'hit' in your code for a long, prefixed named used as a constructor, or possibly a static method called on a factory. After that, if you're dealing with object instances, then instead of function names (which would need to also use a longish prefix, because they are scoped globally), you can use plain old short method names. -- Patrick_Mueller@us.ibm.com IBM PHP Community Architect, IBM Research Triangle Park