Re: Re: [RFC] Namespace syntax decision
| From: | Felipe Pena | Date: | Sat, 22 Mar 2008 23:07:12 +0000 |
| Subject: | Re: Re: [RFC] Namespace syntax decision | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-36344@lists.php.net to get a copy of this message | ||
Em Sáb, 2008-03-22 às 17:19 -0500, Gregory Beaver escreveu:
> Felipe Pena wrote:
> > Em Sex, 2008-03-21 às 17:01 -0500, Gregory Beaver escreveu:
> >>> 1) namespace foo { }
> >> This is acceptable if nothing can exist outside namespace foo {} except
> >> declare and other namespace declarations.
> >>
> >
> > Indeed!
> >
> > Here's my try:
> > http://felipe.ath.cx/diff/namespace.diff
> > http://felipe.ath.cx/diff/namespace.phpt
> >
>
> Hi Felipe,
>
> The patch is pristine coding, but I do think the error message needs
> some loving:
>
> + if (zend_do_namespace_check(TSRMLS_C) == FAILURE) {
> + zend_error(E_COMPILE_ERROR, "Only namespace declaration is allowed
> in the script");
>
> This implies that only "namespace" is allowed, and would be confusing to
> 99% of users. Might I suggest this error message instead:
>
> "This script contains namespaces, all other code must be contained
> within namespace declarations"
Nice. Patch updated! :)
--
Regards,
Felipe Pena.