Re: namespace examples (solving name resolution order issues)
| From: | Chuck Hagenbuch | Date: | Mon, 08 Sep 2008 21:57:47 +0000 |
| Subject: | Re: namespace examples (solving name resolution order issues) | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-40378@lists.php.net to get a copy of this message | ||
Quoting Greg Beaver <greg@chiaraquartet.net>:
Part 3: judgment of value Current approach: advantages: 1) internal classes resolve very fast disadvantages: 1) potential unexpected name resolution to internal class when namespaced classname exists New approach: advantages: 1) code runs the same regardless of load order or autoload disadvantages: 1) serious performance slowdown on each internal class name resolutionIn my opinion the unexpected name resolution to internal classes is a serious flaw in the current namespace implementation, and will cause a lot of confusion or (in my case) avoiding namespaces altogether. The clincher for me is that the performance ramifications can be solved with the exact same workaround that is currently necessary for all user-defined classes (use ::Exception) AND - in PHP user-defined classes are far more common and numerous than internal classes. So I would be extremely happy to see this change go into PHP 5_3. Thanks, Greg! -chuck