Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:34296 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 1628 invoked by uid 1010); 31 Dec 2007 12:33:19 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 1612 invoked from network); 31 Dec 2007 12:33:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Dec 2007 12:33:19 -0000 Authentication-Results: pb1.pair.com smtp.mail=markus@fischer.name; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=markus@fischer.name; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fischer.name from 213.46.255.22 cause and error) X-PHP-List-Original-Sender: markus@fischer.name X-Host-Fingerprint: 213.46.255.22 viefep18-int.chello.at Solaris 10 (beta) Received: from [213.46.255.22] ([213.46.255.22:65013] helo=viefep11-int.chello.at) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F9/3D-02434-C81E8774 for ; Mon, 31 Dec 2007 07:33:17 -0500 Received: from genuine.home ([84.112.136.139]) by viefep11-int.chello.at (InterMail vM.7.08.02.02 201-2186-121-104-20070414) with ESMTP id <20071231123315.JPNX20158.viefep11-int.chello.at@genuine.home>; Mon, 31 Dec 2007 13:33:15 +0100 Received: from chello084112136139.36.11.vie.surfer.at ([84.112.136.139] helo=[192.168.1.51]) by genuine.home with esmtpa (Exim 4.50) id 1J9Jj8-0005Bs-LS; Mon, 31 Dec 2007 13:26:45 +0100 Message-ID: <4778E18A.3080605@fischer.name> Date: Mon, 31 Dec 2007 13:33:14 +0100 User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Jessie Hernandez CC: internals@lists.php.net, dmitry@zend.com, stas@zend.com References: <476878B4.8000200@gmail.com> In-Reply-To: <476878B4.8000200@gmail.com> X-Enigmail-Version: 0.95.5 OpenPGP: id=C2272BD0; url=http://markus.fischer.name/my_public_key.txt Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: -26 X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "genuine.home", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I started a scratch project with this patch and working with it seems intuitive so far. [...] Content analysis details: (-2.7 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -3.3 ALL_TRUSTED Did not pass through any untrusted hosts -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] 2.0 RCVD_IN_SORBS_DUL RBL: SORBS: sent directly from dynamic IP address [84.112.136.139 listed in dnsbl.sorbs.net] 1.2 AWL AWL: From: address is in the auto white-list Subject: Interfaces name "Interface", was: [PHP-DEV] Re: Idea for namespace lookup resolution From: markus@fischer.name (Markus Fischer) -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I started a scratch project with this patch and working with it seems intuitive so far. My only question at the moment is the following, however I guess it isn't specific to your NS patch then to Dmitry's: My current practice to declare an interface and provide concrete implementation was like this: file: Foo/Bar/Interface.php interface: Foo_Bar_Interface Now this gets problematic: file: Foo/Bar/Interface.php namespace: Foo::Bar; interface: Interface The last one doesn't work, because the source actually looks like: interface Interface { which gives syntax error, unexpected T_INTERFACE, expecting T_STRING I tried something like namespace Foo; interface Bar::Interface; but that gives another parser error about the :: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting '{' Is there any chance for Rescue for this, instead of changing the naming scheme? thanks, - - Markus Jessie Hernandez wrote: > Attached is a patch implementing my proposal. > > Basically, when inside a namespace, you must reference global classes > using ::globalName or by having a "use ::globalName" statement. This > allows classes inside namespaces to have the same name as internal ones > without the need of explicitly "use"-ing them (and prevents clashes with > new internal classes in the future). This only applies to classes, > functions/constants will still follow the current rules, since > __autoload does not apply to them (meaning you won't have to do things > like ::strlen just because you're inside a namespace). > > Also, no errors are generated when using a class with the same name as > an internal class, BUT there is an error if you import/alias a class > with the same name as a global (non-internal) class. The reason for this > is that the user has control of which global classes they're including, > while the same might not be true of internal classes. > > Some tests had to be modified to support the patch, and there might be a > need for additional tests to be included, but at least you can all try > out the patch and see how you feel about these new rules. > > Please look at the patch, try it out, and let me know what you think > about it or if there's anything that can be improved. Thanks. > > > Regards, > > Jessie Hernandez > Zend Certified Engineer (http://zend.com/zce.php?c=ZEND006359&r=222727282) > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHeOGK1nS0RcInK9ARAmsFAKC98h2eUH+CusL/h8X4pT5A3EH3SwCg4Jxg M+S0xyhNEbc/BzLxSY/UO0M= =jR9j -----END PGP SIGNATURE-----