Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54653 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60420 invoked from network); 17 Aug 2011 21:15:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Aug 2011 21:15:17 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmgx.michael@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmgx.michael@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.170 as permitted sender) X-PHP-List-Original-Sender: dmgx.michael@gmail.com X-Host-Fingerprint: 74.125.82.170 mail-wy0-f170.google.com Received: from [74.125.82.170] ([74.125.82.170:34896] helo=mail-wy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 19/50-56760-36F2C4E4 for ; Wed, 17 Aug 2011 17:15:16 -0400 Received: by wyf23 with SMTP id 23so1060390wyf.29 for ; Wed, 17 Aug 2011 14:15:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=pJu+YIDKfzHkPgduhB/RhZg+koMVuGK0fNXamCnLnk4=; b=ksfHF8uCbolAKmQayfuKpL2rRlKG4DVIQA0VPw7Msjo1840Y1ifCtbphKFY5vcGkvz Tut2H7iYPHMB54qE/xyQARNhzbQnfWTuu03SQGzIdpLyvrrRhgC9j5H7+fTjnuenHhT9 5dlNOc9OvwinAL3O1X5ziPADpf1545+rkeDz8= MIME-Version: 1.0 Received: by 10.216.156.148 with SMTP id m20mr1247087wek.56.1313615713075; Wed, 17 Aug 2011 14:15:13 -0700 (PDT) Received: by 10.217.6.195 with HTTP; Wed, 17 Aug 2011 14:15:13 -0700 (PDT) In-Reply-To: References: <4E481136.3090508@sugarcrm.com> <4E483284.4010100@googlemail.com> <4E4838E1.3000006@sugarcrm.com> <4E48430D.6070409@googlemail.com> <4E486A50.4010700@sugarcrm.com> <4E48A22E.1040900@googlemail.com> <4E48AD3E.6010801@sugarcrm.com> <4E48C126.50707@sugarcrm.com> <4E48D848.1070407@sugarcrm.com> Date: Wed, 17 Aug 2011 17:15:13 -0400 Message-ID: To: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001636833a84f3029304aab9fd15 Subject: Re: [PHP-DEV] [RFC] Function autoloading through spl_autoload* From: dmgx.michael@gmail.com (Michael Morris) --001636833a84f3029304aab9fd15 Content-Type: text/plain; charset=ISO-8859-1 This member of the peanut gallery would like to point out the following danger. Consider the following function collection for namespace A. namespace A; function strpos() {} function myfunc() {} Now if I understand the RFC correctly there's an unintuitive problem as follows - if myfunc is called first, strpos gets redefined for that namespace and functions as the author might expect for the namespace. If strpos gets called first then it will behave as it does in the global namespace, which may or may not be desirable. In any event, from where I stand here in userland, this is potentially confusing. I'm an amateur of the 1st degree, but my gut tells me that the behavior state of any given function should NOT be determined by whether or not a different function was invoked before it. On Mon, Aug 15, 2011 at 5:49 PM, Chris Stockton wrote: > Hello Stas, > > On Mon, Aug 15, 2011 at 1:26 AM, Stas Malyshev > wrote: > > Hi! > > It's not a shortcoming, it was designed that way, and for very serious > > reasons. If you want to know the reasons, there were discussed > extensively > > when namespaces were discussed. Please re-read that discussion. And all > > things you propose now were already discussed back then too. If you hope > > people would write \strlen instead of strlen, this discussion is > pointless > > because it won't happen. > > -- > > I see your viewpoint from a architectural/design perspective and they > are valid, but I think the impact and design could be lightened with > some simple rules of precedence. > > I think it would be fair to say, autoloader will not be called on a > function like strpos, or any builtin compiled extension. Only once > those are cycled through will autoloader for functions be called. At > this point the performance penalty doesn't exist, because at this > point the program execution would have halted with a fatal error > anyways. > > -Chris > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --001636833a84f3029304aab9fd15--