Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:41645 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 47663 invoked from network); 4 Nov 2008 16:43:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Nov 2008 16:43:06 -0000 Authentication-Results: pb1.pair.com smtp.mail=steph@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=steph@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 64.99.136.148 as permitted sender) X-PHP-List-Original-Sender: steph@php.net X-Host-Fingerprint: 64.99.136.148 smtprelay-virgin0148.hostedemail.com Received: from [64.99.136.148] ([64.99.136.148:55754] helo=smtprelay-virgin.hostedemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 60/07-15458-99B70194 for ; Tue, 04 Nov 2008 11:43:05 -0500 Received: from filter.hostedemail.com (ff-bigip1 [10.5.19.254]) by smtprelay04.hostedemail.com (Postfix) with SMTP id 6D9B840B32; Tue, 4 Nov 2008 16:42:58 +0000 (UTC) X-SpamScore: 1 X-Spam-Summary: 2,0,0,37d6d31eb9702dc4,691ff1dea13fdf9b,steph@php.net,greg@chiaraquartet.net:cschneid@cschneid.com:mls@pooteeweet.org:internals@lists.php.net,RULES_HIT:355:379:539:540:541:542:543:567:599:601:945:973:988:989:1155:1156:1260:1277:1311:1313:1314:1345:1437:1515:1516:1518:1534:1541:1587:1593:1594:1711:1730:1747:1766:1792:2073:2075:2078:2194:2199:2379:2393:2559:2562:2693:2828:3027:3353:3622:3740:3865:3866:3867:3868:3869:3870:3871:3872:3873:3874:3876:3877:4250:5007:6114:6119:6261:7653:7875:7903:8501:9108,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:none,DNSBL:none Received: from foxbox (62-31-252-63.cable.ubr07.shef.blueyonder.co.uk [62.31.252.63]) (Authenticated sender: steph.fox) by omf12.hostedemail.com (Postfix) with ESMTP; Tue, 4 Nov 2008 16:42:56 +0000 (UTC) Message-ID: <02e001c93e9c$a8874f30$3ffc1f3e@foxbox> To: "Gregory Beaver" , "Christian Schneider" Cc: "Lukas Kahwe Smith" , "PHP Development" References: <49048EC1.9060908@chiaraquartet.net> <49061E01.8060503@zend.com> <11c607a60810271344i1a8cf53fl149447ad2f687f99@mail.gmail.com> <490628DB.9060209@zend.com> <11c607a60810271422l68949427pe31786275b0b152c@mail.gmail.com> <08747094-6B50-4A0D-9057-DFD12108B6C6@caedmon.net> <94CCB864-179A-48DA-A89A-3859796A9257@pooteeweet.org> <49063A1D.7070804@zend.com> <4906405F.7090205@zend.com> <490747B2.2010201@zend.com> <4D9A8597-EFE6-418A-B7F6-EAD9ED2361A5@pooteeweet.org> <7FA6946B-57B9-4BC0-B2F1-AFD47572F363@pooteeweet.org> <491071EC.7020501@cschneid.com> <49107527.7060604@chiaraquartet.net> Date: Tue, 4 Nov 2008 16:44:50 -0000 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-session-marker: 73746570682E666F78 Subject: Re: [PHP-DEV] namespace separator and whining From: steph@php.net ("Steph Fox") Hi Greg, all, > For this reason, the only resolution that we should be considering is: > > classes: > 1) try ns::class > 2) autoload ns::class > 3) fail > > functions/constants: > 1) try ns::function/ns::const > 2) try internal function/const > 3) fail. I see this as giving priority to library authors rather than the average PHP user. So here's another option - and if I mention the word INI, will y'all promise to read to the end before you shout at me? We could have an INI_SYSTEM switch. ns.lookup=Off means you _have_ to prefix because otherwise resolution will fail with a fatal error, but ns.lookup=On means that anything not prefixed and not local goes through the full lookup, i.e. it does what is currently done outside a namespace context. You'd switch ns.lookup off during development and on in production, and the default would be on. Prefixed elements would be found at the first try regardless of the setting, but would fail after a single check for a global value if the element is not found when the setting's off. Non-prefixed code would fail when the setting's off, but would otherwise get by except in cases of ambiguity (easily remedied with a '\'). It would, however, run slower and be more prone to conflict, particularly in complex sites or applications. We make it very, very clear in the docs that prefixing is best practice, but at the same time we allow John Doe to import a couple of namespaced libraries without putting him through prefix hell. What am I missing? - Steph