Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97974 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18244 invoked from network); 26 Jan 2017 20:23:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jan 2017 20:23:56 -0000 Authentication-Results: pb1.pair.com header.from=rasmus@mindplay.dk; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=rasmus@mindplay.dk; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain mindplay.dk from 209.85.216.178 cause and error) X-PHP-List-Original-Sender: rasmus@mindplay.dk X-Host-Fingerprint: 209.85.216.178 mail-qt0-f178.google.com Received: from [209.85.216.178] ([209.85.216.178:35575] helo=mail-qt0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 64/32-28703-ADA5A885 for ; Thu, 26 Jan 2017 15:23:55 -0500 Received: by mail-qt0-f178.google.com with SMTP id x49so94770787qtc.2 for ; Thu, 26 Jan 2017 12:23:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mindplay-dk.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=SPkeThjt6hdcvHGQR5fe+ntxaF9SoSIVzXZ1fbEq3Ts=; b=ERWRtKCP/8iJ/BoXew4ZYg/uyFk8yhgcsW536C+pPBBmefQsGOnoYnru3X8Wat3I00 57RcWnef2W4OyN/1AAvJFPPxNElaYdFd8TBUiRPpB5zh4GcAFD+NSLbeRNN/UmMmbO8K /I1S0MugPzbRLNtaEgrFDAc6VgeL3z/gZGzTcozQV9bUC1cSuORPFxfLyvo2XQ5bzC6l dK1ro/k+O0xKpZaqdHgpHKlY4UZH4xRt6s1f/nw3KB1lzCgh/6Quo/4QRa9gfuKh3nrG LvYLV1LutokL3MzD/kbamIOYM49mRH2bsJ172PNaiYqVofCeFWMmba15RgqbKVkAIjU7 cO0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=SPkeThjt6hdcvHGQR5fe+ntxaF9SoSIVzXZ1fbEq3Ts=; b=SszwxRIKn/AM0LR5ZBBNnSxus3ykqBPnYhazi9qwoSwc36xUfnGBz1vtHDmd945E0I Ugn7jUFQKX/Rvjm0RHWXWtwmXChRqDIySuj3C+787oeEv0e+ccBk2WxUrNKXgugDCIyO LPd173rGHWHp024h5/Z0/sRmhtWD6lYjcW8XbB++Uk+fnT7G3YM8XIkcpqO45ZZwmFhD 1UWUqLpU/SLTN31j0pfn6D+NDOEGCy7v2F9+rU0B7okBu78L+STI938fHhGA+z232FZH nE1qgZ+MVi0pGP46XhkZMFuCjdcA5bsMKZSAQtqI3e92dl7OKkjdNI1hXNVERyVYduJM XpKw== X-Gm-Message-State: AIkVDXJSnRd7NIFP7d+IgZOP8BBv/8c6RXzOUvSYn3HUala0T1mz3BINxswlsn2b+jYF3orgWIs4QdWjocCl3A== X-Received: by 10.200.47.129 with SMTP id l1mr4480476qta.148.1485462231507; Thu, 26 Jan 2017 12:23:51 -0800 (PST) MIME-Version: 1.0 Received: by 10.237.47.231 with HTTP; Thu, 26 Jan 2017 12:23:51 -0800 (PST) In-Reply-To: References: <24.D0.04124.AABB9885@pb1.pair.com> Date: Thu, 26 Jan 2017 21:23:51 +0100 Message-ID: To: Niklas Keller Cc: Andrea Faulds , PHP internals Content-Type: multipart/alternative; boundary=001a113776f2a30be9054705205d Subject: Re: [PHP-DEV] Re: Not autoloading functions From: rasmus@mindplay.dk (Rasmus Schultz) --001a113776f2a30be9054705205d Content-Type: text/plain; charset=UTF-8 > if you choose to use static methods instead of functions It's not a choice - functions are practically useless in a Composer context, and most everything PHP is now Composer packages. > why do you need this special syntax for calling them then? Yeah, but the same logic applies to namespaces and classes: If you choose to use namespaces, why do you need aliases for classes? Strictly speaking, you don't - but it would be really ugly and inconvenient. Forcing you to qualify a namespace or the parent class of a function repeatedly is just noise, same as qualifying the namespace before every class or interface-reference. Agreed, it has no functional value, but neither does namespace-aliasing. Both have a considerable organizational benefit though: the ability to list all your class, interface and function imports at the top of a file. To me, that's valuable. Either way, guys, here's a preliminary RFC: https://wiki.php.net/rfc/use-static-function While trying to describe this, I have to say, this doesn't appear to be the slam-dunk it seemed to be - you can read the details on that page, but given the two alternative approaches described on this page, it seems this feature is likely to create just as many problems and WTF as the auto-loading RFC. I'm afraid one isn't much better or worse than the other in that sense really... Oh well :-/ On Thu, Jan 26, 2017 at 6:50 PM, Niklas Keller wrote: > > The problem with stop-gap measures is they become entrenched, and the >> proper solution doesn't get implemented >> >> This would be my general point of view - unfortunately, functions are >> essentially useless at present, in a world with Composer, unless you're >> willing to preload all functions from all packages up-front. >> >> The only suggested solutions I've heard for the name resolution issue with >> function autoloading frankly are all horrible - much worse than this >> simple >> alternative. >> >> Add to that the fact that likely 90% of all functions in the wild (at >> least >> in Composer packages) are currently implemented as public static >> functions, >> and in my opinion, this is starting to sound less like a stop-gap and more >> like a simple solution to a problem we've been solving with a stop-gap >> for, >> oh, 10 years or so... > > > Again, if you choose to use static methods instead of functions, why do > you need this special syntax for calling them then? > > Regards, Niklas > --001a113776f2a30be9054705205d--