Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54629 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99401 invoked from network); 15 Aug 2011 21:30:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Aug 2011 21:30:13 -0000 X-Host-Fingerprint: 96.2.18.191 host-191-18-2-96.midco.net Date: Mon, 15 Aug 2011 17:30:12 -0400 Received: from [96.2.18.191] ([96.2.18.191:20010] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 28/A1-21941-4EF894E4 for ; Mon, 15 Aug 2011 17:30:12 -0400 Message-ID: <28.A1.21941.4EF894E4@pb1.pair.com> To: internals@lists.php.net References: User-Agent: slrn/pre1.0.0-18 (Linux) X-Posted-By: 96.2.18.191 Subject: Re: [PHP-DEV] [RFC] Function autoloading through spl_autoload* From: weierophinney@php.net (Matthew Weier O'Phinney) On 2011-08-14, Derick Rethans wrote: > On Sat, 6 Aug 2011, Ferenc Kovacs wrote: > > 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 > > I understand the proposal, but I don't see any compelling reasons in the > RFC of why we actually need autoloading for functions? For classes it > makes sense because there is almost always a class to file mapping. For > functions (and constants) that is not the case, so I am wondering how > useful this function autoloading actually is. Namespaces support the following code types: * Constants * Functions * Classes and Interfaces Currently, autoloading in PHP allows us to dynamically identify and load only classes and interfaces. However, not all code is written using OOP. If a developer doesn't want to dive into include/require(_once) hell in order to use their namespaced functions and/or constants, they have no real options. As an example, let's say I've created a procedural CMS or blog of some sort. In there, I have a file like this: