Re: my last attempt at sanity with namespaces
| From: | Greg Beaver | Date: | Thu, 16 Oct 2008 17:11:57 +0000 |
| Subject: | Re: my last attempt at sanity with namespaces | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-41148@lists.php.net to get a copy of this message | ||
Stanislav Malyshev wrote:
> Namespaces aren't autoloadable, classes are. But what I see happening
> is that people would start converting excisting code, and since they
> are human they will inevitable forget or miss class here and there.
> And it would work, and pass all tests, and look fine and dandy on the
> outside - but under the water it would contain the performance bomb of
> non-cacheable exhaustive autoload search. It is a big disservice for
> our users to put them into this situation where you need to be an
> expert to even notice where the problem is - especially that we
> *already* know the problem exists and we *know* how to fix it. Why not
> just fix it?
Hi Stas,
Was your proposal to do this for name resolution:
<?php
namespace blah;
$a = new Exception;
1) if for blah::Exception exists, use it
2) try to autoload blah::Exception
3) fail
instead of having the internal resolution? I would support this, and am
sorry if I mischaracterized your proposal in solution to issue #2. I
really thought I was proposing the thing you all worked out at ZendCon,
it was a simple misunderstanding on my part.
Greg