Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37970 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 79627 invoked from network); 28 May 2008 16:27:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 May 2008 16:27:58 -0000 Authentication-Results: pb1.pair.com smtp.mail=letssurf@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=letssurf@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.132.241 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: letssurf@gmail.com X-Host-Fingerprint: 209.85.132.241 an-out-0708.google.com Received: from [209.85.132.241] ([209.85.132.241:29247] helo=an-out-0708.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A1/A0-10063-A088D384 for ; Wed, 28 May 2008 12:27:57 -0400 Received: by an-out-0708.google.com with SMTP id c14so626216anc.1 for ; Wed, 28 May 2008 09:27:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=4fxPELNOEC0h8X5rBb5eOvwrCMXX/vgr9VCs1IUxskM=; b=PjXr38fHgGsFLHx0/y+aBhUoZBXb2dxkVM4solOJZCrFcRaoJEISFQL5tMD6LYJYEiwtT8G47lalQCJyIsxGRpOdCftapjw0Z6lOK9juACOi3XxDQaA4rM78ntmH80gTIM+TphqQjlRkV4YRb1NDMzqPlwNRK2QvkhTKujxaigA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=kZ0eB+OBGaiqA0t7bscw+ApXyS09TDoHK6FdsAdY6PKHHIjguOuf2AFtEAEGBEqAIo5rk0S1doyvnVPbaIPG0lKRaTAZ75CQoSaVjHXgVtsKhQL8U2pQYh2Uf6f5q/TZR9n8A1yznXTD/5170BmmIwMqVBgjG0PIwdE2rMKyaB4= Received: by 10.100.96.9 with SMTP id t9mr2510148anb.143.1211992071633; Wed, 28 May 2008 09:27:51 -0700 (PDT) Received: by 10.100.126.9 with HTTP; Wed, 28 May 2008 09:27:51 -0700 (PDT) Message-ID: <462e563f0805280927w46cb0a3fra8b546e8219dd9ab@mail.gmail.com> Date: Wed, 28 May 2008 17:27:51 +0100 To: internals@lists.php.net MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_2046_25868153.1211992071626" Subject: Name resolution rules From: letssurf@gmail.com ("James Dempster") ------=_Part_2046_25868153.1211992071626 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline I find the namespace resolution rules quite confusing. It's become quite difficult to tell if I'm calling a static method or a function, or namespaced static method or namespaced function, and so on. I don't quite fully understand or appreciated the point of namespaces. If some one could help me out here. -- google.php -- '; echo '2 '.__FILE__.' #'.__LINE__.' '.Google::search().'
'; echo '3 '.__FILE__.' #'.__LINE__.' '.Google::test().'
'; echo '4 '.__FILE__.' #'.__LINE__.' '.Other::test().'
'; 1. behaved as I expected it to. 2. didn't do what I thought it should have done, now the class is broken, but wouldn't though any exception. 3. behaved as I expected it to. 4. wow strange I've managed to rename my class though namespace resolution rules. I feel that namespaces are going to cause some big problems. Shouldn't it wait for PHP6 rather than backport to PHP5. This is only one of the problems I've come across with namespaces. Is it going to be possible to get to the google class search method? I find it terrible that now a name *DOES* clash, but this time with out so much as an error! I preferred it to highlight the fact that I had a class with the same name. Any thoughts? /James ------=_Part_2046_25868153.1211992071626--