Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54656 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 69159 invoked from network); 17 Aug 2011 22:20:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Aug 2011 22:20:16 -0000 Authentication-Results: pb1.pair.com header.from=ekneuss@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ekneuss@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.42 as permitted sender) X-PHP-List-Original-Sender: ekneuss@gmail.com X-Host-Fingerprint: 209.85.214.42 mail-bw0-f42.google.com Received: from [209.85.214.42] ([209.85.214.42:36809] helo=mail-bw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 77/D1-56760-D9E3C4E4 for ; Wed, 17 Aug 2011 18:20:14 -0400 Received: by bkd19 with SMTP id 19so1108253bkd.29 for ; Wed, 17 Aug 2011 15:20:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=5E03ZYZfkKAL0icuRCnl2YULkgoC0LaG0OCuh2c8wh0=; b=XB32HOr3pX8hFl0aQKSvvYT2LzTRF5yRd/ytoMPokpCtY+VY3NwJZ7k1o9Wg2v4hM8 vvPlRymyXz0RU2DczG9nYWk8t/n0WlMH/Tbn6G43xL4D3IX/QPAZX0If84xBhU5Ecmug 3IiOucxOjufEIt522jOd/v1YfcC6YgIQ1vLbg= MIME-Version: 1.0 Received: by 10.205.65.4 with SMTP id xk4mr669130bkb.374.1313619611216; Wed, 17 Aug 2011 15:20:11 -0700 (PDT) Sender: ekneuss@gmail.com Received: by 10.204.103.198 with HTTP; Wed, 17 Aug 2011 15:20:11 -0700 (PDT) In-Reply-To: <4E4C3D7D.3040606@googlemail.com> References: <4E4C3D7D.3040606@googlemail.com> Date: Thu, 18 Aug 2011 00:20:11 +0200 X-Google-Sender-Auth: sHJ5EGLhznir3eYgLsIWQbE88q0 Message-ID: To: Sebastian Krebs Cc: internals@lists.php.net Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC] Function autoloading through spl_autoload* From: colder@php.net (Etienne Kneuss) Hi, On Thu, Aug 18, 2011 at 00:15, Sebastian Krebs wrote: > Hi, > > With this mail I don't want to talk to anyone directly, but I just want to > summarize the situation as far as I understand. > > > --- > - Autoloading constants > --- > No problem here: When the loading procedure fails, it gets converted to a > string like before. It may be a performance impact, but the code, that > relies on this "feature" gets flooded with warnings anyway. > > > > --- > - Autoloading functions > --- > If I understood it right the only problem is, that *someFunction()* may be > in the global, as well as in the current namespace. This means, the > developer write a function in a namespace, that already exists in the global > scope, which remains to feel quite scary to me. Its way more confusing, that > (e.g.) *strpos()* don't behave, like expected and learned for years now. > > It will affect only single namespaces, because if you want to call a > function from another namespace you must prefix it with a qualified or > full-qualified namespace anyway. > And last but not least: Currently you must include the files containing the > functions yourself. This means, that existing code is _not_ affected, > because as long as no one removes the include-statements, it even not call > any autoloading. But when the developers decides to remove them, they > probably wants to use the autoloading, what means, that they (hopefully) > understand, how it works. > > However, in my opinion the important part is to just make a decision the > sooner, the better, as long as there are not too much creepy code out there > (I don't know any and I can't imagine, that there is). Because functions > with namespace are quite unhandy without autoloading and I don't think, that > there is much use of it. > > So the 2 possible solutions: > > 1: > - test namespace > - test global > - load namespace > - load global > > 2: > - test namespace > - load namespace > - test global > - load global > > Also: 4: - test namespace - test global - load namespace > Maybe > 3: > - test namespace > - test global > - load global > - load namespace > would be a solution too, but it seems a little bit curious, when I use > namespaces, but it looks into the global scope first. > > Regards, > Sebastian > > Am 06.08.2011 13:15, schrieb Ferenc Kovacs: >> >> Hi. >> >> I would like to introduce this RFC which would provide function >> autoloading through the spl_autoload facility without userland BC >> breakage. >> >> https://wiki.php.net/rfc/autofunc >> > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Etienne Kneuss http://www.colder.ch