Re: Re: [RFC] Namespace syntax decision

From: Date: Sat, 22 Mar 2008 22:19:13 +0000
Subject: Re: Re: [RFC] Namespace syntax decision
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-36341@lists.php.net to get a copy of this message
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" Greg

« previous php.internals (#36341) next »