Re: [PATCH] Re: [PHP-DEV] namespace examples (solving name resolution order issues)
| From: | Stanislav Malyshev | Date: | Tue, 09 Sep 2008 16:39:06 +0000 |
| Subject: | Re: [PATCH] Re: [PHP-DEV] namespace examples (solving name resolution order issues) | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-40416@lists.php.net to get a copy of this message | ||
Hi!
a use statement. For those who aren't clear on what Stas is saying, here is the better example: <?php namespace PEAR2::Pyrus::PackageFile::v2Iterator; use namespace::File, namespace::FileAttribsFilter, namespace::FileContents; ?>No, actually that's not what I meant. You can do this too, but I meant just use namespace::File. There's no law about using :: in the code, really. Just write namespace::File, it's both short and clear.
Now for the good news. The reason it is so slow is that the autoload is called for every single invocation of the class name. With the patch at http://pear.php.net/~greg/resolution_fix.patch.txt this performance isWhat this patch does?
Now that the performance hit is minimal, can we agree to get along on this proposed change Stas? ;) It transforms the critical nature of the problem to a truly minor performance hit on internal class usage without use or ::.Please read my response to your previous email, I have described there issues with your proposal and how to make it non-contradictory and what else needs to be done. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com