Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120091 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 41905 invoked from network); 20 Apr 2023 21:48:05 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 20 Apr 2023 21:48:05 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7DA92180554 for ; Thu, 20 Apr 2023 14:48:04 -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,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-oo1-f52.google.com (mail-oo1-f52.google.com [209.85.161.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 20 Apr 2023 14:48:01 -0700 (PDT) Received: by mail-oo1-f52.google.com with SMTP id 006d021491bc7-546de76c23eso705770eaf.0 for ; Thu, 20 Apr 2023 14:48:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682027280; x=1684619280; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=BxBsTqiIuRN1n17DtB/RADuB2ZvzYJKnOFs3p98dWyg=; b=mp+FB+ewA4wGVvPTHy9Tb7eCE8s/4Y82lRwyZEWOlAedBbDp/FLmHUNwJa4cxtNSMz 0BKOAa9jlsKMH+Cizm4mRSAhXHs1jXWkskE9QQsmH1EF6t2OAAIrNCs+6tHnAbA/oln8 sdN5zO/x2L5nCBjT5FZT8VjPHtdJMfvEVOiHyIIoHhdVLksDfotpshCKljv2wiAMz6mU /YTYfmZzZKfv5+/riDZm9pCseF5zy+hPUd6lpT49+LE+F7tJK9vANDYqRyO29+Wv6aXM +ngv4gnGtykU8Th+lvKhj3nHAI2/hn+nQnvxrZ9jyrn80O5P7Y7KAAqwev/TvEO+NdDU EEqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682027280; x=1684619280; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=BxBsTqiIuRN1n17DtB/RADuB2ZvzYJKnOFs3p98dWyg=; b=PSmBKVc4HGCqulyFvxaFrnGTcu0ajyPiA2HiGIqDy4BwNKZZnhljSf9BSHa/VhT1u2 T84IMc6zpOyhmcZ0NWxldTfRSxyTccSX06Nsv6l0aCPe33vSSoVRj6lm1HJYRzAk37mI +vODBk/XgGph5BIQiIASRpaBae3PR0obArqv4mi6JTlR3/NsiqO38SfDMEXGivvM5S7v I9kmZyGsdJO6I0KuBaihUhIc15VJjeGoWsBNK2LtS9n/+Kf6ZxuHXoMjWwQeTjpeicDs oi4nd5h/gEsohA17tHk7G4llhRioaq1cZIKTwEyKuRWOzwIhMTj8iIjo1YVz5/erJ28C OYHQ== X-Gm-Message-State: AAQBX9eBvnGTLd4QbCjPszy9n4vWbfQhw+MeQG1DDGYy/6XpuiIkeP69 fHqcmCaLeWjqCSyZT7TgitAuNlSHh5UQhXmf1YNmd3Pv X-Google-Smtp-Source: AKy350adBEI+YRl3T7TetafwJTCdDClxKppTKRj62msFf3W1hIycdUEdgXFIkyIBX80+9os3/PuLMH6oekNzXDvP394= X-Received: by 2002:a05:6820:1049:b0:542:3be5:9692 with SMTP id x9-20020a056820104900b005423be59692mr183350oot.5.1682027280182; Thu, 20 Apr 2023 14:48:00 -0700 (PDT) MIME-Version: 1.0 References: <6b5de716-d769-4f0b-b3e6-5a5a211f035a@app.fastmail.com> In-Reply-To: <6b5de716-d769-4f0b-b3e6-5a5a211f035a@app.fastmail.com> Date: Thu, 20 Apr 2023 22:47:48 +0100 Message-ID: To: Larry Garfield Cc: php internals Content-Type: multipart/alternative; boundary="00000000000089b17d05f9cb7eaa" Subject: Re: [PHP-DEV] [Discussion] Callable types via Interfaces From: davidgebler@gmail.com (David Gebler) --00000000000089b17d05f9cb7eaa Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Apr 20, 2023 at 6:25=E2=80=AFPM Larry Garfield wrote: > ## The options > > There's three ways we've come up with that this design could be > implemented. In concept they're not mutually exclusive, so we could do > one, two, or three of these. Figuring out which approach would get the > most support is the purpose of this thread. > My initial feelings based on the options laid out is that anything which can't support FCCs in the manner of strlen(...) is probably a non-starter in terms of language design. Changes like this are fundamentally about making things simpler, more concise and more convenient for users, not drip-feeding a stream of "and here's yet another way of working with..." features across releases. Structural typing option seems like the easiest to implement in the engine (correct me if I'm wrong?) and probably the best syntax for the user within the interface approach. But then do we really want to introduce new runtime checks and complexity when the general trend of the language has been in the opposite direction? I imagine probably not. So out of the three, I lean towards adding castTo() to Closure and it maybe raises a to-be-determined Throwable if the closure is already bound? It's not as friendly for the user as the other options but it seems like the most workable, it delivers value and it most closely fits within the existing way of working with all types of closure today. -Dave --00000000000089b17d05f9cb7eaa--