RE: [PHP-DEV] Simple Namespace Proposal
| From: | Dmitry Stogov | Date: | Thu, 05 Jul 2007 15:58:34 +0000 |
| Subject: | RE: [PHP-DEV] Simple Namespace Proposal | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-30462@lists.php.net to get a copy of this message | ||
Names in namespace will never conflict with user names in global namespace.
Dmitry.
> -----Original Message-----
> From: Brian Moon [mailto:brianm@dealnews.com]
> Sent: Thursday, July 05, 2007 7:24 PM
> To: Dmitry Stogov
> Cc: 'David Coallier'; 'Stefan Priebsch'; 'PHP internals';
> Stanislav Malyshev
> Subject: Re: [PHP-DEV] Simple Namespace Proposal
>
>
> Dmitry Stogov wrote:
> > I think the following example is much better, however I am not sure
> > it's a right direction. Namespaces are intended to declare
> names that
> > can conflict with names from other namespaces (including global
> > namespace), do I am not sure that we need special keyword
> for internal
> > functions.
> >
> > We'll think little bit more. Anyway thank you for feedback and idea.
> >
> > <?php
> > namespace UTF8;
> >
> > overloaded class Exception {
> > }
> >
> > overloaded function strlen() {
> > }
> > ?>
>
> I could live with this. Would this only override built-in
> functions or
> any function in the global scope. Or, rather, would you have
> to do this
> for all functions in the global scope? If so, I see a new
> problem. =)
> If I write my project using name spaces, and have all my functions
> inside the Phorum namespace and some other project does not use
> namespaces and has the same function name, my project now
> throws errors
> if I do not use overloaded.
>
> --
>
> Brian Moon
> Senior Developer
> ------------------------------
> http://dealnews.com/
> It's good to be cheap =)
>