Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100476 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90392 invoked from network); 8 Sep 2017 22:46:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Sep 2017 22:46:24 -0000 Authentication-Results: pb1.pair.com smtp.mail=ocramius@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ocramius@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.46 as permitted sender) X-PHP-List-Original-Sender: ocramius@gmail.com X-Host-Fingerprint: 74.125.82.46 mail-wm0-f46.google.com Received: from [74.125.82.46] ([74.125.82.46:45856] helo=mail-wm0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B7/92-10715-EBD13B95 for ; Fri, 08 Sep 2017 18:46:22 -0400 Received: by mail-wm0-f46.google.com with SMTP id f199so11813600wme.0 for ; Fri, 08 Sep 2017 15:46:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=jDzVFTjAOxw60rUobAYtXL244C7192jGFILnYaZEfEA=; b=fyikIk4edgC3zCW/nrS0gzXedRAR9FmAlpdL6tIHrqMTGIoYV+EnhIMgRX86Kdvby7 QUjn3XKY1DF/Fq5OrH/yifQ0pkyeZKYGuABFFi3rT6nNRV8oUdYz+XdWC8JScLxglm26 gfubf/T0u5eXqta0po/iY6/33am9UiUZe3LHtYHOXs2+1e7N7UyRXAHW/8HPvj99Vfyc pYU+5vRalzxmUuWCXJz9sC9b9s/B+VDdlmXKJiV6VBhlmemYjAUDhBO3AhWi6A3scXRF EFjV34w4y82EDeNvSJAg8+AMeHTwNeRlLjvjH6BVOiYodIMsskklVkTjhuqp+OU4+m6p Yegg== 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=jDzVFTjAOxw60rUobAYtXL244C7192jGFILnYaZEfEA=; b=WAt+C1fzr/nprGozK6QXiEFXeTiY7dUvfLmelE/rO66iSHtArkFlHuTMcpxVVpCfE2 5wMNj/rKOufl1XrnwczpsVthOBhhjLsRaYEH2WuT8qnTYnFgl9WSUAlBlXuwWL/+L2M0 UgSDOQDsZFN6EoyG1nWqgk6DeaU2l0OPPwx8G2hG4iVWANL0t8+zMZx9XjN3lGWRKaqV hMrJ7gK6Ga1xXWjEt5/LNa5oB0qf4O8qZknnGpiTHh+Kthudo2g2f6L8Xhq3bOwz/vRV R5V8o1K2BDKqssFVlWzsfQ4Pazn7UHZyI+zSndyHlNQyd6jAZycXOE67eFClfmNkmPHo eXWg== X-Gm-Message-State: AHPjjUjIrVOsfpdb9ehau1uMRSvji+zc9lzmwthXAa7t9rZo1csAfUF0 9q6h1jb90qxd6trc0xxtiAmLyoplvk3Z9gQ= X-Google-Smtp-Source: AOwi7QDFaRyRMtDSgRg9sRQtD6yAvwAVarc6f4FlGDAWbcrK6CJf6na0U96KCdb99rYF1C9biCH8sbDJBrM5ilo10ZQ= X-Received: by 10.28.8.21 with SMTP id 21mr2492809wmi.23.1504910779548; Fri, 08 Sep 2017 15:46:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.164.6 with HTTP; Fri, 8 Sep 2017 15:45:58 -0700 (PDT) In-Reply-To: <82.32.10715.A8E03B95@pb1.pair.com> References: <82.32.10715.A8E03B95@pb1.pair.com> Date: Sat, 9 Sep 2017 00:45:58 +0200 Message-ID: To: Andrea Faulds Cc: PHP Internals List Content-Type: multipart/alternative; boundary="001a114426406f0aac0558b558e5" Subject: Re: [PHP-DEV] [RFC] [Discussion] Operator functions From: ocramius@gmail.com (Marco Pivetta) --001a114426406f0aac0558b558e5 Content-Type: text/plain; charset="UTF-8" On Fri, Sep 8, 2017 at 11:41 PM, Andrea Faulds wrote: > Hi everyone! > > Here's an RFC for a small, simple, self-contained feature with no > backwards-compatibility breaks and which in fact doesn't even touch the > language's syntax (it's 50%+1 eligible!) but which could make PHP a bit > more expressive and consistent, especially with potential later features. > It even has a test designed to impose minimal maintenance burden while > testing a fairly large possibility space! > > Anyway, the RFC in question is this: https://wiki.php.net/rfc/opera > tor_functions > > Please tell me what you think and suggest any potential improvements or > anything you think might have been an omission. > > Thanks! > -- > This is bloody brilliant! Stupid example, but: function factorial(int $i) { return array_reduce(range(1, $i), "*", 1); } I see great potential in this: moving away from operators as weird syntactic sugar and in the direction of operators as functions (what they actually are). Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ --001a114426406f0aac0558b558e5--