Re: Call it: allow reserved words in a class or not?
| From: | Josh Thompson | Date: | Fri, 07 Nov 2008 13:47:59 +0000 |
| Subject: | Re: Call it: allow reserved words in a class or not? | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-41757@lists.php.net to get a copy of this message | ||
Johannes Schlüter wrote:
On Thu, 2008-11-06 at 22:19 -0600, Josh Thompson wrote:But we don't reliably know all possible classes in the namespace example, where we can be autoloading the classes. In the wildcard example we (c/w)ould already be autoloading the classes anyway, but instead of sending the class names (A and B) we would send it the namespace class names first (foo\bar\A and foo\bar\B) and then if that failed try without the namespace. If one of the classes (B for example) is in the global namespace, then the developer can simply prefix it with a (\B) to save on one autoload call. I still don't see the fundamental difference between the namespace and wildcard example. -- Joshua Thompson Mechanical Engineer/Software Developer http://www.schmalls.comI don't understand why in the namespaced example no one seems to have a problem with new A() meaning new \foo\bar\A(), but we can't use the * wildcard to do the same thing?Since we don't reliable know all possible classes, think about _-autoloading classes, which means we'd have to do more work during execution, which can be a slowdown. johannes