Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:41437 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53731 invoked from network); 27 Oct 2008 11:37:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Oct 2008 11:37:07 -0000 Authentication-Results: pb1.pair.com smtp.mail=sv_forums@fmethod.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=sv_forums@fmethod.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fmethod.com from 69.16.228.148 cause and error) X-PHP-List-Original-Sender: sv_forums@fmethod.com X-Host-Fingerprint: 69.16.228.148 unknown Linux 2.4/2.6 Received: from [69.16.228.148] ([69.16.228.148:59505] helo=host.fmethod.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6A/FB-34199-2E7A5094 for ; Mon, 27 Oct 2008 06:37:07 -0500 Received: from [83.228.56.37] (port=1281 helo=pc) by host.fmethod.com with esmtpa (Exim 4.69) (envelope-from ) id 1KuQP9-00077S-Hy for internals@lists.php.net; Mon, 27 Oct 2008 06:37:03 -0500 Message-ID: <69907CB6763C4164A1AE82D659B80286@pc> To: Date: Mon, 27 Oct 2008 13:36:55 +0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0095_01C93839.13AE4850" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host.fmethod.com X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - fmethod.com Subject: Clarifying the resolution rules From: sv_forums@fmethod.com ("Stan Vassilev | FM") ------=_NextPart_000_0095_01C93839.13AE4850 Content-Type: text/plain; charset="windows-1251" Content-Transfer-Encoding: quoted-printable Hi, Now that we have a separator, it's time to clarify what happened to the = resolution order for functions and classes, which if I read Greg's = messages, is still not clearly defined. 1) I think we've established that autoloading + fallback for classes is = unworkable, as it either causes excessive autoload triggering, or = alternatively allows internal classes to override unloaded but = to-be-autoloaded namespaced classes. Then why is it still under = consideration? 2) Making the backslash optional for internal functions means popular = drop-in replacements for internal functions and extensions in global = space, which work today, will break in a namespace, examples: = libcurlemu. Also check any comments on PECL functions on php.net, and = you'll see a myriad of drop-in replacements people use today. Also, for those who want to automatically convert their internal = functions to backslash prefix for use in namespaces, you can use this = quick snippet I wrote (works in 5.2.x too): http://pastebin.com/f13125acd I don't make guarantees it's perfect, but it can be improved and given = to people as a porting aid. Opinions about how disruptive a mandatory backslash for global symbols = *in namespaces* would be, are welcome. Keep in mind that making the = backslash optional will lead to code breakage (such as for above drop-in = replacements, class autoloading etc.) and slower performance (runtime = resolution of function calls). Think of it as file paths. When you're inside a directory you need to = prefix your path with "/" (eg "\") to refer to the root, but you don't = need to do that when you're in the root directory. Regards, Stan Vassilev ------=_NextPart_000_0095_01C93839.13AE4850--