Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68782 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 77091 invoked from network); 31 Aug 2013 18:03:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Aug 2013 18:03:45 -0000 Authentication-Results: pb1.pair.com smtp.mail=krebs.seb@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=krebs.seb@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.51 as permitted sender) X-PHP-List-Original-Sender: krebs.seb@gmail.com X-Host-Fingerprint: 74.125.82.51 mail-wg0-f51.google.com Received: from [74.125.82.51] ([74.125.82.51:37197] helo=mail-wg0-f51.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E2/E2-55332-00032225 for ; Sat, 31 Aug 2013 14:03:45 -0400 Received: by mail-wg0-f51.google.com with SMTP id b12so2577096wgh.30 for ; Sat, 31 Aug 2013 11:03:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=obXrO5IUK78fkNVTRBhTE43x+gREiT93DkX1VIT7b9I=; b=fclwQje6S3WqH/LSQf2rDeTnJAUa6vrXk4Db2O5/uzd/x6bLj8lXKqo03wL+UDn1m2 UDBNTjoOer/I9CxlRPX1J5ysHW4DcMSiHgJm84JLpQ4V5iaIUSXTgN5ZN7fSTj99UW2W hMkL+/5eGmq/6pRjWnWc/iuuLw7B81TvUL+YrgLCr0eXC8AKfScfKaotVCWS9lw+iSiM /73AQ8lSiuys0e7ZPDTHx3chfcGr6LIhSWx/B34mW4l84IYnxwPqZU8xrN+U8TYrau4H jB2yIABKuF8EAJsauIDbybQefAcEyWqkPuUh42oAjHP7rt1bjqwK4DTre/MDd9dOtMAE EXgA== X-Received: by 10.180.182.228 with SMTP id eh4mr7006149wic.45.1377972222076; Sat, 31 Aug 2013 11:03:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.5.9 with HTTP; Sat, 31 Aug 2013 11:03:01 -0700 (PDT) In-Reply-To: <61FCD6C4A31248078FEAD2BA73D7CD44@gmail.com> References: <5220262A.6040702@sugarcrm.com> <5220437A.7050008@sugarcrm.com> <5220D212.3010101@sugarcrm.com> <61FCD6C4A31248078FEAD2BA73D7CD44@gmail.com> Date: Sat, 31 Aug 2013 20:03:01 +0200 Message-ID: To: Vartolomei Nicolae Cc: Nikita Popov , Stas Malyshev , Sara Golemon , Anthony Ferrara , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=089e016347faceb14904e54228a6 Subject: Re: Function autoloading From: krebs.seb@gmail.com (Sebastian Krebs) --089e016347faceb14904e54228a6 Content-Type: text/plain; charset=ISO-8859-1 2013/8/31 Vartolomei Nicolae > So you say you will create a file for every function you want to support > autoloading? > I already _have_ create files for functions of a namespace... Closed source. > As I already asked, tell us about realworld use case, for example where > this could improve say big projects like Symfony or ZF. > Not everything can be found in the 5 most popular frameworks. > There is no logic to add this functionality just because we can. > The lack of logic is: Why is it actually missing? - Classes: Triggers an autoloader - Functions: Needs manual handling - Constants: Needs manual handling That is at first inconsistent. The need of "require_once"s is inefficient and error prone. Regards, Sebastian > > > > 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 smalyshev@sugarcrm.com)>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 > > > -- github.com/KingCrunch --089e016347faceb14904e54228a6--