Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114828 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 7222 invoked from network); 11 Jun 2021 10:46:28 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 11 Jun 2021 10:46:28 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 21BFD1804C9 for ; Fri, 11 Jun 2021 04:01:58 -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=-0.4 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_H2,SPF_HELO_NONE,SPF_PASS,URIBL_SBL, URIBL_SBL_A autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) (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 ; Fri, 11 Jun 2021 04:01:57 -0700 (PDT) Received: by mail-lf1-f53.google.com with SMTP id i10so7972719lfj.2 for ; Fri, 11 Jun 2021 04:01:57 -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=pmdel5buw3LdTGYq3OiByru3ifRWIs4g0JTaaelsrUU=; b=oucFmDq0CLxzRfLk+3j2mPL8+xe/UhMo8ELcz5qYlgdlsgmjNaH0o0Lh2eAvAimp40 W5apNVwJk+99z0ClsdjfCqsPc8iUt9mnUBASTJlh0qv2x0ajZ2vTmEM3XJX5c4ew6Tki xc55DxJXDifxEKuLQE8mA0Vc9W3XrdFCr5C6OjG3qdalXdCZRPH+o+yZuGNhH2pKyDY5 qHFFRQTvbIBNJvdJtCl7hZtgQK8cOpMCig/11Ee4cjNmQ/6HNxM4nhqMTslmFlirxAEP xmdSuYAvyrKcXaCktxP0VSPlbryW+tYGHo2jeE7H3z56X8as8u9XRjcaZaoMeHMAJMnk EyDA== 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=pmdel5buw3LdTGYq3OiByru3ifRWIs4g0JTaaelsrUU=; b=kskgIPLWmpeifX8NBeuGivq27pPp4W5eJNN5zk0mmZbWx717dtiHqK1bbETYFOV78p Ig7QNSsFp4H4Fnf3yF2MDkIgzDn2pbpBeD8AvUEX2u2WbbwZnxndvOZBbHjteUoP2skY nheOpTR3KFd7PEKHitbiSzmJB7czph7hqx2+3ai4NQSWX6TZUNGtnWgzActCL0RJQazc 9THlFu3B02ImoTqr+aSOeTOyA+HDuUxCvCKMmEsbcsudmlJzB0JSJPGcA77K1AUAQkwT XRHRzmuq6WXsOQ+skDbzRLxNrncwn07Bwpvu3dpdoPsmcUYzR/LMaqPrduDxcXhjatFh pniw== X-Gm-Message-State: AOAM532M6k58s6H7WGwpQvPVtLY0HXSiZfTQ/PzuXgEbnrSIN+r3X+yb P4TgQEUqY93w8f1Fu5PovBdT4LJ+wVjTY5xk2LiwpxhPjLwt/Fw= X-Google-Smtp-Source: ABdhPJycrB9H25z00wI1MLIL4J35VU1sfY6+XPGqzd+LNk2++0csGq84j5llOmVdhGBY+/s+bFf/0mOtSnw09bNryRI= X-Received: by 2002:a05:6512:3749:: with SMTP id a9mr2392616lfs.110.1623409314179; Fri, 11 Jun 2021 04:01:54 -0700 (PDT) MIME-Version: 1.0 References: <9adf063b-2598-4dd4-9e2b-cf2cd4f53b86@www.fastmail.com> In-Reply-To: <9adf063b-2598-4dd4-9e2b-cf2cd4f53b86@www.fastmail.com> Date: Fri, 11 Jun 2021 13:01:43 +0200 Message-ID: To: Larry Garfield Cc: php internals Content-Type: multipart/alternative; boundary="0000000000007f2ba205c47b6fb3" Subject: Re: [PHP-DEV] [RFC] Partial Function Application, take 2 From: guilliam.xavier@gmail.com (Guilliam Xavier) --0000000000007f2ba205c47b6fb3 Content-Type: text/plain; charset="UTF-8" Sorry, me again :s I have tested the examples from https://wiki.php.net/rfc/partial_function_application on https://3v4l.org/#focus=rfc.partials and several of them currently give an error: - Ex 10: on the line `$c = stuff(?, ?, f: 3.5, ..., p: $point);` => Fatal error: Named arguments must come after all place holders (typo I guess, `$c = stuff(?, ?, ..., f: 3.5, p: $point);` is OK) - (Ex 11: no error but a typo: `'hi'` vs `'foo'`) - Ex 16: for the last call `(four(..., d: 4, a: 1))(2, 3);` => Fatal error: Uncaught ArgumentCountError: four(): Argument #2 ($b) not passed (on the function definition line) (`(four(..., d: 4, a: 1))(2, 3, 5, 6);` idem, but `(four(..., d: 4, a: 1))(b: 2, c: 3);` throws an "Unknown named parameter $b" Error on the call line) (weird) - func_get_args() and friends: one the last line `$f(1, 2);` (after `$f = f(?);`) => Fatal error: Uncaught Error: too many arguments for application of f, 2 given and a maximum of 1 expected (can make sense, e.g. https://externals.io/message/114532#114554 ) - (Callable reference: no error but a typo: `$f` vs `$foo`) - Optimizations: on the line `$boo = $baz(4, ...);` => Fatal error: Uncaught Error: too many arguments and or place holders for application of Closure::__invoke, 1 given and a maximum of 0 expected (`$boo = $baz(?);` throws the same error, but `$boo = $baz(4);` throws a "not enough arguments for implementation of foo, 4 given and exactly 5 expected" Error, and `$boo = $baz(...);` makes the subsequent `$boo(5);` throw a "not enough arguments ..." Error) (weird, looks like `$bar = $foo(2, ...);` and/or `$baz = $bar(3, ...);` dropped too many params) Regards, -- Guilliam Xavier --0000000000007f2ba205c47b6fb3--