Re: namespace separator and whining
| From: | Greg Beaver | Date: | Sun, 26 Oct 2008 20:08:27 +0000 |
| Subject: | Re: namespace separator and whining | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-41391@lists.php.net to get a copy of this message | ||
Sebastian Bergmann wrote:
> Greg Beaver wrote:
>> The decision is made, now I suggest everyone get busy actually trying
>> it out.
>
> How are we supposed to try it out? There is no updated implementation
> yet, and I would rather discuss a specification instead.
As Steph pointed out, I toiled for about 18 hours to create a working
patch *before* the IRC meeting just to be sure there weren't any hidden
gotchas.
http://pear.php.net/~greg/backslash.sep.patch.txt
This patch is unreviewed by Zend Engine experts, and so should be
considered a proof of concept only and not a final implementation.
> It was mentioned on IRC that internal functions have to be prefixed with
> \ when used in a namespaced file. Without a fallback. This is insane.
This is not true, and the unit tests demonstrate that resolution in fact is:
1) check for namespaced\functionname
2) check for internal functionname
and the same is true for both constants and classes. In fact, the class
resolution is what it has always been
1) check for namespaced\classname
2) check for internal classname
3) try to autoload namespaced\classname
which is planned to be changed to
1) check for namespaced\classname
2) try to autoload namespaced\classname
3) check for internal classname
or even
1) check for namespaced\classname
2) try to autoload namespaced\classname
So not all details are completely nailed down, but these are independent
of whether \ or :: or &*@$#% is used as the separator, and would *not*
be fixed by removing functions and constants because the two issues have
nothing to do with one another.
Thanks,
Greg