Re: towards a 5.3 release
| From: | Stanislav Malyshev | Date: | Thu, 17 Jul 2008 17:57:31 +0000 |
| Subject: | Re: towards a 5.3 release | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-39063@lists.php.net to get a copy of this message | ||
Hi!
In other words, with the current implementation, you can just do "use Foo::Exception;" and it works, but if you *forget* to do the use statement, you can get unpredictable behavior with no warning until yourYou get previctable behavior in all cases, there's no randomness in the engine.
to "use ::Exception", then your code is simply slightly slower (1 extra call to autoload if it exists), but still works properly. It also tiltsIt's not slightly slower, it's *A LOT* slower - exhaustive search of whole include path for *EACH* call mentioning internal class. That means you have to declare *EACH* internal class - even if no clashes ever existed - for *EACH* use. Basically, it's the same as always using ::Class only implemented in a way that its disastrous effects are hidden until you check performance of your code. Then you have to go back and add use statement for each internal class in each of your files. Lot's of fun that would be. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com