Re: [RFC] Namespaces for internal classes
| From: | Johannes Schlüter | Date: | Fri, 04 Jul 2008 09:15:28 +0000 |
| Subject: | Re: [RFC] Namespaces for internal classes | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-38755@lists.php.net to get a copy of this message | ||
On Fri, 2008-07-04 at 10:28 +0200, Lars Strojny wrote:
> Hi Derick,
>
> Am Freitag, den 04.07.2008, 10:14 +0200 schrieb Derick Rethans:
> > I'd say this is a BIG no-no. PHP owns the top-level namespace. Why
> > make things harder? And on top of that, you're suggesting just to
> > break code for no good reason in "Backwards compatibility and other
> > constraints".
>
> Quoting the proposal: "The current names are available as deprecated
> aliases until their removal". This means that until we decide to remove
> the old names, the current ones are available. I'm currently
> investigating how to implement an ADD_DEPRECATED_CLASS_ALIAS-macro.
> Classes/interfaces created with this warning would trigger an
> E_DEPRECATED warning.
That's not entirely true, there are minor BC breaks: Let's say Bar is an
alias for Foo::Bar. now to $r = new ReflectionClass('Bar'); echo
$r->getName(); and you'll get 'Foo::Bar' as that's the name in the CE,
same goes for error messages, stack traces, ... (I'Ve seen people
parsing them...)
johannes