Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68745 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 71138 invoked from network); 30 Aug 2013 17:38:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Aug 2013 17:38:46 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.176 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.220.176 mail-vc0-f176.google.com Received: from [209.85.220.176] ([209.85.220.176:36346] helo=mail-vc0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 35/48-32511-5A8D0225 for ; Fri, 30 Aug 2013 13:38:45 -0400 Received: by mail-vc0-f176.google.com with SMTP id ha11so1494594vcb.21 for ; Fri, 30 Aug 2013 10:38: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:date:message-id:subject:from:to :cc:content-type; bh=oa9Pu7foQGWveyo/7z5MAk2mcEl9HKfzwj4qRqucMJA=; b=aeYUQj1Gd/hmDVX+GvMMhwBv9a6x1O6wpGnNmCabzZFsRBVN5caxnEXTSAL8dtTqLA wRZpMZwDWH7LisEcsZ1Stc8dHx0VhRNJsz/XZuwcP8VRWGuU/DKNgn59TD1txHdZ/WUu btTgMttAHG3jMH9ri9F8Dnw2qfz7YWkvbBwvxzufZAQ3kW96lEUmgbWT6UN2SMRPQkSU 4CEQVvCHKQKdA7XpVso7/Eo6GA2IdNpPlT3fajHGmD1bKcohvrCAZnCkBjqiaGELQP5n T02yrr9766KKHrq4JBL3kVH1isHhtiSp7yeeepVi4hM5F3iERDUm8NicP8OWqMz7Fg1q NgIA== MIME-Version: 1.0 X-Received: by 10.58.54.70 with SMTP id h6mr89320vep.36.1377884322273; Fri, 30 Aug 2013 10:38:42 -0700 (PDT) Received: by 10.220.17.136 with HTTP; Fri, 30 Aug 2013 10:38:42 -0700 (PDT) In-Reply-To: <5220D212.3010101@sugarcrm.com> References: <5220262A.6040702@sugarcrm.com> <5220437A.7050008@sugarcrm.com> <5220D212.3010101@sugarcrm.com> Date: Fri, 30 Aug 2013 19:38:42 +0200 Message-ID: To: Stas Malyshev Cc: Sebastian Krebs , Sara Golemon , Anthony Ferrara , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=089e0122ad06921fed04e52db16f Subject: Re: [PHP-DEV] [DRAFT] [RFC] Function autoloading From: nikita.ppv@gmail.com (Nikita Popov) --089e0122ad06921fed04e52db16f Content-Type: text/plain; charset=ISO-8859-1 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 --089e0122ad06921fed04e52db16f--