Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54655 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 67480 invoked from network); 17 Aug 2011 22:16:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Aug 2011 22:16:31 -0000 Authentication-Results: pb1.pair.com smtp.mail=krebs.seb@googlemail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=krebs.seb@googlemail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.214.68 as permitted sender) X-PHP-List-Original-Sender: krebs.seb@googlemail.com X-Host-Fingerprint: 209.85.214.68 mail-bw0-f68.google.com Received: from [209.85.214.68] ([209.85.214.68:56182] helo=mail-bw0-f68.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 93/71-56760-28D3C4E4 for ; Wed, 17 Aug 2011 18:16:30 -0400 Received: by bkat2 with SMTP id t2so277789bka.11 for ; Wed, 17 Aug 2011 15:15:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=/jFHkz3QU0HU0QQBRU+l6IfLFdiF2GMz7d2V9KKCBGQ=; b=obsua19Me87EQrt96WxyJiBsDZGaTkRfJzBASBcTYnqedEdM62FxsNdeAQ63Bz12lg N9b8C9lR9vxuicGSe/pQ9lBHdX8U6sRJl4n76ov0KjpXEzlrpi5jN6tk0MdFd9Wvxqn/ Cgbi4VPeQ4oL/iXfEU6Y7BzV6psM2eVgdbv0Y= Received: by 10.204.169.65 with SMTP id x1mr644415bky.264.1313619327336; Wed, 17 Aug 2011 15:15:27 -0700 (PDT) Received: from [192.168.24.2] (91-64-205-130-dynip.superkabel.de [91.64.205.130]) by mx.google.com with ESMTPS id o20sm259746bku.10.2011.08.17.15.15.26 (version=SSLv3 cipher=OTHER); Wed, 17 Aug 2011 15:15:26 -0700 (PDT) Message-ID: <4E4C3D7D.3040606@googlemail.com> Date: Thu, 18 Aug 2011 00:15:25 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110617 Thunderbird/3.1.11 MIME-Version: 1.0 To: internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Function autoloading through spl_autoload* From: krebs.seb@googlemail.com (Sebastian Krebs) 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 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 >