Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:36341 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38636 invoked from network); 22 Mar 2008 22:19:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Mar 2008 22:19:15 -0000 Authentication-Results: pb1.pair.com header.from=greg@chiaraquartet.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=greg@chiaraquartet.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain chiaraquartet.net from 38.99.98.18 cause and error) X-PHP-List-Original-Sender: greg@chiaraquartet.net X-Host-Fingerprint: 38.99.98.18 beast.bluga.net Linux 2.6 Received: from [38.99.98.18] ([38.99.98.18:55951] helo=mail.bluga.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 93/29-16027-1E585E74 for ; Sat, 22 Mar 2008 17:19:13 -0500 Received: from mail.bluga.net (localhost.localdomain [127.0.0.1]) by mail.bluga.net (Postfix) with ESMTP id AC92FC0FF59; Sat, 22 Mar 2008 15:19:09 -0700 (MST) Received: from [192.168.0.106] (CPE-76-84-4-101.neb.res.rr.com [76.84.4.101]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.bluga.net (Postfix) with ESMTP id 58223C0FF36; Sat, 22 Mar 2008 15:19:09 -0700 (MST) Message-ID: <47E585E1.9060307@chiaraquartet.net> Date: Sat, 22 Mar 2008 17:19:13 -0500 User-Agent: Thunderbird 2.0.0.12 (X11/20080227) MIME-Version: 1.0 To: Felipe Pena CC: internals@lists.php.net References: <1789567073.20080321223647@marcus-boerger.de> <47E43032.20507@chiaraquartet.net> <1206186368.5916.3.camel@pena> In-Reply-To: <1206186368.5916.3.camel@pena> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP Subject: Re: [PHP-DEV] Re: [RFC] Namespace syntax decision From: greg@chiaraquartet.net (Gregory Beaver) 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