Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114164 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 55256 invoked from network); 25 Apr 2021 21:03:56 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 25 Apr 2021 21:03:56 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D6C401804DB for ; Sun, 25 Apr 2021 14:07:47 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 25 Apr 2021 14:07:47 -0700 (PDT) Received: by mail-ej1-f42.google.com with SMTP id l4so81383233ejc.10 for ; Sun, 25 Apr 2021 14:07:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jPVvNsOvS0Y40uhiyzgxKnrGawB+mcH7MPgAMupohWg=; b=uR8xonPmN3bpo4f0goJBDaWM/iPlfT/tpIh/FFjwQTJhNygJD/p45WyUEny5dhotQN +Uig1bUg7xKcj2fj/ND85ZkLro9z5tYILzENs/LlqTqaISgGMgfvomO0OhOHxy+Cj6QR xvBFrLI8MInFJXEp3FtEI+BU5qz4pC8pTzLfVt4Kp4380YnarSolewGwgkF58N8JKHjq a7QpZ5OnYkcTlVTgwOxr1ZJJjuN3zI4ncqASvKrEOJoNWnA5kCpoK2PKKF2PbMSt/oDc yQ7ENMiV4hNgBw89lhjEXTz6uKrWdbx21bw6UiwuGx8dc5Ejhkg12tLqxcNQALLIlW5V RMQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jPVvNsOvS0Y40uhiyzgxKnrGawB+mcH7MPgAMupohWg=; b=sqEf2GjcF0DuMgAeBSvzMqcgGDYoukycyiYhjqY1JswTZnkAqRd4dxvl5iQH/BX+Fe Brb3ASIcKS9C/H6WZhLPWqJ/KbvRY/VLn8MiXh2a49LCyiSCqOATxsKsuNff3GnQrHZ3 apLDvuG4m7JBx+jRHUcavmHCywqMK75gRecTw5zde97o522xbhsd6hrjMu/dm5vnLyUE 4cj504akCMUqTDTTIoAmcaL9KBc/XFHGRylnAA+B0rT5NrTt/bud6227Z1amEAbxffvC PSzM61FOx47ebBsmz0JviYK0yGOJ/vbwQLkYz4V2xjIZl3YEDcQBy3Ch3+4aE/Yd8ZNz K5XA== X-Gm-Message-State: AOAM530wilmXd0t/rm58jGFURHm/RofRxdaxJA//AKlJmp71NCKBsSYe 1VTUqr+7fFSdXDZ9kVU8nvgMLEJE8MoQHw7I0yk= X-Google-Smtp-Source: ABdhPJzb8a4lMGO2LLoMKj7ij+cQPII7B9OnGk75AEwg0/bubMT+9WrZRqlc/wBfznV8PfkYAL954kQ4v8Fz8zRMRj0= X-Received: by 2002:a17:906:d7b1:: with SMTP id pk17mr7633690ejb.294.1619384862981; Sun, 25 Apr 2021 14:07:42 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 26 Apr 2021 00:07:27 +0300 Message-ID: To: =?UTF-8?Q?Olle_H=C3=A4rstedt?= Cc: Larry Garfield , php internals Content-Type: multipart/alternative; boundary="00000000000083428805c0d26bf4" Subject: Re: [PHP-DEV] [RFC] Partial function application From: maxsem.wiki@gmail.com (Max Semenik) --00000000000083428805c0d26bf4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Apr 25, 2021 at 10:26 PM Larry Garfield wrote: > https://wiki.php.net/rfc/partial_function_application Amazing, I've wanted this for so long! Have you considered extending this syntax to OOP, e.g. $obj->method(?) or SomeClass::staticMethod(?)? On Sun, Apr 25, 2021 at 10:51 PM Olle H=C3=A4rstedt wrote: > Nice. :) Are there any other motivating use-cases besides pipe > operator (that are relevant for web dev)? One reason I'm personally excited about this proposal is that it would allow static analysis in more cases, e.g. $param =3D 'fooBar'; // What's this string? A user name? Elon Musk's favori= te color? Text of US Constitution? somefunc($param); function somefunc($cb) { $cb(123, 'meh'); // What parameter types does this accept? } Allowing syntax like $param =3D fooBar(?, ?); would indicate clearly what this variable receives. Analysis tools would then be able to check if such a function exists and whether it would receive parameters of expected types= . --=20 Best regards, Max Semenik --00000000000083428805c0d26bf4--