Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119408 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 92330 invoked from network); 23 Jan 2023 21:53:02 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 23 Jan 2023 21:53:02 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8F1EF18037F for ; Mon, 23 Jan 2023 13:53:01 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE,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-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.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 ; Mon, 23 Jan 2023 13:53:00 -0800 (PST) Received: by mail-ej1-f52.google.com with SMTP id rl14so30880027ejb.2 for ; Mon, 23 Jan 2023 13:53:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=basereality-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=By958c+0wfUShX5iSlSEQNzqozaAv7XEqUmJ15xjZ6Y=; b=q9Ib0GkF1fmXNwIqNk6TtXE3qeCO8vMVsjwo7sLGFItImYI6J9kBFmThDY0ppGyALX lbURs0GsPlLpxBqzG2Bxry1kl30ZZyvbG1CRx1hgsiPadlxLFGPcTanXMiUr9GQzhpoZ RLf8+LmxJkEx1u63YqdpRHF2cy3NltjNAi1VFE7q64Xm7/Y3U7cVnFDXQRQLhf0ipESv te/RyMKN6bdqpMBFpDjoCFxKfxxp8N1IE+aLPAc3mRb52q7Ewn6avBEafTP6OiElnbeM j5h3nnY6LViPimiTB+h9jUb340Zgb41v2PhLblO1Z0BJ2qfxbBlpcItIMWnwiH0UpXfO n8PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=By958c+0wfUShX5iSlSEQNzqozaAv7XEqUmJ15xjZ6Y=; b=dj7ZZ8fsSkzQ5tbi07qqMWWOUVOrgX77fT4FxHilc3UfAlIvMTbltuXmEgsIw45gAw 0cFmwcJDnDQZ4Cz1lKotICvdDjHwtQfdEyUThLns4F/xKtNRlYRvYrvBVswNsLpv5mN9 UzeCQB90CtxO95PxqSxEgKxZtK6jjWR+FN/PebK6aZTtC8vL3bDLAaFxoIkMeJZqHKpT cO3QZvpCCAXpCRv20c5g5DHvSXne5f/dVE2bGfvFhnDKlx29zfhA6vH78b5XTXyzx2nG Apc+jWD/3OBB0fz1RJcFXQEumQkO7v7sJP+3XrwREtzoszGU9uv3iiAarEVmIIUDzT4O YasA== X-Gm-Message-State: AFqh2kosEpbguS6JmZfmCdRoVvIEMHcvW7CY1Ub+NwiqQSLqgsvQtip3 klVLQqGyBydomWMWXlgBK6P1kc9gdsAnmv8sPaO3n76tPTJaku7s X-Google-Smtp-Source: AMrXdXvXEbK+pS7qLN77fiSP66IdbVghzXJYGqKI6pY9spabNFFIQ+l3N2ipLrLoLdm0yYRhWOvCaypiKM6WkhkB3pw= X-Received: by 2002:a17:907:c9a9:b0:870:e0b2:7c06 with SMTP id uj41-20020a170907c9a900b00870e0b27c06mr3894357ejc.580.1674510779614; Mon, 23 Jan 2023 13:52:59 -0800 (PST) MIME-Version: 1.0 References: <8f530a4a-bf48-4259-877e-16ebf8082936@app.fastmail.com> <9c97b0b1-e17e-4eec-8cf5-fad86aca2da6@app.fastmail.com> In-Reply-To: <9c97b0b1-e17e-4eec-8cf5-fad86aca2da6@app.fastmail.com> Date: Mon, 23 Jan 2023 21:52:48 +0000 Message-ID: To: Larry Garfield Cc: php internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] Introduce the abiltiy to use the first-call-callable syntax on non-static methods, statically From: Danack@basereality.com (Dan Ackroyd) On Mon, 23 Jan 2023 at 20:51, Larry Garfield wrote: > > On Mon, Jan 23, 2023, at 12:32 PM, Dan Ackroyd wrote: > > > > > $fnConstructor = Closure::fromClassConstructor(Zoq::class); > > // signature of $fnConstructor is the same as `function(Fot $fot): Zoq` > > > > Or for individual methods: > > > > $fnMethod = Closure::fromClassMethod(Zoq::class, 'Pik'); > > // signature of $fnMethod is the same as `function(Zoq $zoq, string > > $zebranky): Frungy` > > I don't think that actually helps. If you have the object already, Neither of new functions I was suggesting have the object already. Only the type. > If you do not have the object already, then we run back into the issue > I pointed out before where we need to differentiate a bindable from > needs-binding callable, That's not what I suggesting. Danack wrote: > > $fnConstructor = Closure::fromClassConstructor(Zoq::class); > signature of $fnConstructor is the same as `function(Fot $fot): Zoq` That doesn't need a binding at all. Danack wrote: > > $fnMethod = Closure::fromClassMethod(Zoq::class, 'Pik'); > signature of $fnMethod is the same as `function(Zoq $zoq, string > $zebranky): Frungy` First parameter is the object to be operated on. You wouldn't need to do any binding. *magic* would happen inside the function to take care of that. > I think that's a prerequisite for adding any dedicated syntax > for "make a closure that doesn't work until it gets bound". To be clear, I don't support anything like that. As I wrote: Danack wrote: > > That sounds like a complete non-starter. Adding something to the > language that produces a closure that can't be called would be an > instant new entry for PHPSadness. cheers Dan Ack