Newsgroups: php.internals,php.internals Path: news.php.net Xref: news.php.net php.internals:20454 php.internals:20455 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32712 invoked by uid 1010); 25 Nov 2005 22:05:38 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 32696 invoked from network); 25 Nov 2005 22:05:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Nov 2005 22:05:38 -0000 X-Host-Fingerprint: 65.9.87.49 adsl-9-87-49.mia.bellsouth.net Received: from ([65.9.87.49:4380] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id F9/2E-56276-2BA87834 for ; Fri, 25 Nov 2005 17:05:38 -0500 To: internals@lists.php.net,Rasmus Lerdorf Message-ID: <43878AAD.5000603@gmail.com> Date: Fri, 25 Nov 2005 17:05:33 -0500 User-Agent: Mozilla Thunderbird 1.0.7-1.1.fc4 (X11/20050929) X-Accept-Language: en-us, en MIME-Version: 1.0 CC: internals@lists.php.net References: <7.0.0.16.2.20051124161240.0573e640@zend.com> <90.0E.56276.6D207834@pb1.pair.com> <200511251419.56809.pookey@pookey.co.uk> <57.B8.56276.65B27834@pb1.pair.com> <73998811.20051125204046@marcus-boerger.de> <438782C6.80008@gmail.com> <43878626.5060300@lerdorf.com> <438788CB.6000704@lerdorf.com> In-Reply-To: <438788CB.6000704@lerdorf.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 65.9.87.49 Subject: Re: [PHP-DEV] Re: PHP 5.1 (Or How to break tousands of apps out there) From: jrhernandez05@gmail.com (Jessie Hernandez) Rasmus Lerdorf wrote: > > Are you saying this works? > > namespace ns { > function foo() { } > } > > function foo() {} > > echo true ? ns:foo():foo(); > > Looks very confusing to me. > > -Rasmus Just tested that, and yes, it does work. If you think about it though, this is excellent. A function foo() in my namespace did not clash with a function foo() in another namespace (in this case, the global namespace). The confusion here really starts when the user imports the function foo in namespace ns without an alias (which one should be used, or should an error be triggered?). This is why I allow the following syntax in my patch (for both classes and functions): import function ns:foo as ns_foo; // or whatever you want Things like these, the appropriate behaviors for different cases, and scoping issues need to be discussed and a consensus must be reached. I'm currently listing all the things that I have encountered and that must be discussed among us all. When I finish, I'll post to the list. Stay tuned... Regards, Jessie