Re: namespace separator and whining
| From: | Stefan Walk | Date: | Tue, 04 Nov 2008 17:19:25 +0000 |
| Subject: | Re: namespace separator and whining | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-41650@lists.php.net to get a copy of this message | ||
On Tuesday 04 November 2008 17:44:50 Steph Fox wrote:
> We could have an INI_SYSTEM switch.
>
> ns.lookup=Off
>
> means you _have_ to prefix because otherwise resolution will fail with a
> fatal error, but
>
> ns.lookup=On
>
> means that anything not prefixed and not local goes through the full
> lookup, i.e. it does what is currently done outside a namespace context.
Dev writes a script, uses autoload, overrides global class.
Distributed to user, that has ns.lookup=On as you propose, user borks his
install, lacks the file containing the class, gets the global class ->
obscure error messages because of nonexisting methods in places unrelated to
the place where the actual error happened. Not really a good idea, IMO.
Failing there is the best option. It's not like you have to prefix every
single occurence, you just have to say at the top of the file "When I say
Exception, I mean \Exception".
Regards,
Stefan