Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68775 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49170 invoked from network); 31 Aug 2013 08:43:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Aug 2013 08:43:31 -0000 Authentication-Results: pb1.pair.com header.from=nvartolomei@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nvartolomei@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.174 as permitted sender) X-PHP-List-Original-Sender: nvartolomei@gmail.com X-Host-Fingerprint: 209.85.215.174 mail-ea0-f174.google.com Received: from [209.85.215.174] ([209.85.215.174:42350] helo=mail-ea0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8C/68-00443-2BCA1225 for ; Sat, 31 Aug 2013 04:43:30 -0400 Received: by mail-ea0-f174.google.com with SMTP id z15so1322785ead.19 for ; Sat, 31 Aug 2013 01:43:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:message-id:in-reply-to:references:subject :mime-version:content-type:content-transfer-encoding :content-disposition; bh=/cZcm1CQ1xV91Q5c/+8e3sLcEpQjYn4YQo0cFQs5dJI=; b=ewcoarv+PVTXjnHXJIZKF++cS8VmqoUQU0qmgFopAYFtxGdqpH3GpXA8P4wsDxXh7o MUkt3HdwA+jkM7pnrnYUniLIKtSXUnr84C31PSkwjic3o1QEscZhALCM1IE/wL/5cTXX q536D3Nghz3sIx5EtjDC3w/mdG5fW6prQRi+Nhs4KN3j3tNbSoz30CyIqx8TynrkQivm vo5hVi/HXmWuZb/VmLg1svsjMCPdh6yfQJOZywnkwmnwD+8tuE3hlCu2ynvySkfaK4G2 EorIfC4fEeJrdabG9i+I3ANXHwPltBqEOX0+pzwxh4100mDIjQ3y3wjSamb/0DsWltgI m5Ng== X-Received: by 10.14.184.3 with SMTP id r3mr2204774eem.49.1377938607432; Sat, 31 Aug 2013 01:43:27 -0700 (PDT) Received: from Pro ([178.168.103.7]) by mx.google.com with ESMTPSA id f49sm3358852eec.7.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 31 Aug 2013 01:43:27 -0700 (PDT) Date: Sat, 31 Aug 2013 11:43:25 +0300 To: Nikita Popov Cc: Stas Malyshev , Sebastian Krebs , Sara Golemon , Anthony Ferrara , "=?utf-8?Q?internals=40lists.php.net?=" Message-ID: <61FCD6C4A31248078FEAD2BA73D7CD44@gmail.com> In-Reply-To: References: <5220262A.6040702@sugarcrm.com> <5220437A.7050008@sugarcrm.com> <5220D212.3010101@sugarcrm.com> X-Mailer: sparrow 1.5 (build 1043.1) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: Re: Function autoloading From: nvartolomei@gmail.com (Vartolomei Nicolae) So you say you will create a file for every function you want to support autoloading? As I already asked, tell us about realworld use case, for example where this could improve say big projects like Symfony or ZF. There is no logic to add this functionality just because we can. kindly, nvartolomei On Friday, August 30, 2013 at 8:38 PM, Nikita Popov wrote: > On Fri, Aug 30, 2013 at 7:10 PM, Stas Malyshev wrote: > > > Hi! > > > > > Well, static methods aren't the same as functions. > > > > The big difference being? > > This seems to be the core of your argumentation in this thread: "Why don't > you just use Foo::bar() instead of foo\bar()?" > > In which case, I wonder why we have functions at all. We could just use > static methods instead after all. Maybe we should deprecate function > support? > > On a more serious note: If you want an actual example of how functions can > be easier to use than static methods, consider the "use function" RFC. Now > that it's in, it is possible to directly import a function foo\bar() and > use it with just bar(). Static methods allow no such thing. You always need > to write the class name. > > The reason why people currently resort to using static methods instead of > functions is the fact that there is no autoloading for functions. With > autoloading, functions become a lot easier to use. > > Nikita