Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129888 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by lists.php.net (Postfix) with ESMTPS id 3446B1A00BC for ; Fri, 23 Jan 2026 13:06:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1769173583; bh=hSeVk5No6us04ZnbyZHKWOBrxmUF+0kNlZNT+no2/qk=; h=Date:To:From:Cc:Subject:In-Reply-To:References:From; b=ajwGj5R3UhDvPs+qVS/fkpbylTaqqWgKX0QuV/n05V80p/F1f8Dwa2pkiM7t0QZdK jbfneeTS5Vrd522MRlgz5DcLQ2vpGWW1irlXmfAG5vDzCoLEOBoqogC6BgX/D5NdPd Oe4ysOejwLVhiD1+fJMGjRzDq1oD+OKlZfqo/RpMjymnoSXSXA5ocC0JQjI8aQ54q0 oJ8I9R0OVPu+v2ydndTJtZpnrabTVa+Tijp+BS1kUs6o2mEFx3I3u6QNvYgNQHHnyf 99V/aNgHUyXrgLYkOK9njds/ML4ArZhwnh2fPrTX2en8WeUDthT8/vcPQRnhgFzjzp dlMJz/Gp98w4g== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E6A0D180039 for ; Fri, 23 Jan 2026 13:06:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-244118.protonmail.ch (mail-244118.protonmail.ch [109.224.244.118]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 23 Jan 2026 13:06:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rochette.cc; s=protonmail3; t=1769173574; x=1769432774; bh=hSeVk5No6us04ZnbyZHKWOBrxmUF+0kNlZNT+no2/qk=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=0X2afjZObv2dUrgGdbBv/zrHcmgjO/L0l05nBpqeZGZEA+pshsf/a2UwdsYuz4o0V nfMnE0oZw/pXX5vGk/QbCznyRIe189NJsDo8pacBZTKkESqMAvAx0nmaoxzgIzSQiP RPRH9STI0pHE+wrvZto3vJGcmNPA2f0GbZeWEU3aqJYWtUlZ9x19kZLoMCR24aRz3g qM/+SkycLVqPIU0pfEKmfw52H+KWYVMgryz1/hsg/IaEYzzHQnCysX9qH1IsVAB/z1 85TYqkrfupDy3vSeUXfS3pdJcFoVmiRioIE3kqOXHoa4GgPJ27DHyiDRTZNnyQpOlK rPINaHhHPy9TQ== Date: Fri, 23 Jan 2026 13:06:11 +0000 To: =?utf-8?Q?Tim_D=C3=BCsterhus?= Cc: php internals , Arnaud Le Blanc Subject: Re: [PHP-DEV] [RFC] Partial Function Application for instance of non-static methods ("$this") Message-ID: In-Reply-To: References: <64953ec741a4c6609519e1878ad37b54@bastelstu.be> Feedback-ID: 37040780:user:proton X-Pm-Message-ID: 10d654a303f9d7d78d4cbe21aedf07bc7aa42a13 Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha512; boundary="------e2452454a84a44a90add1a588128e9e96590676bcadca11aa281397273445635"; charset=utf-8 From: mathieu@rochette.cc (Mathieu Rochette) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------e2452454a84a44a90add1a588128e9e96590676bcadca11aa281397273445635 Content-Type: multipart/mixed;boundary=---------------------9677d71739fa917fbf6ceb4ecbee0bd9 -----------------------9677d71739fa917fbf6ceb4ecbee0bd9 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain;charset=utf-8 Mathieu Rochette On Friday, January 23rd, 2026 at 09:37, Tim D=C3=BCsterhus wrote: > Hi > = > Am 2026-01-22 18:30, schrieb > = > Mathieu Rochette > = > : > = > > I often whished something like this existed :) Didn't get trough to > > suggest it because I wasn't sure of the syntax either (and lazyness) > = > = > Thank you for participating in the discussion of this RFC then. Having > more voices available helps building things that suit the community best > :-) > = > > still, my syntax suggestions: > > = > > array_map(DateTimeImmutable->format("c"), $dates); > = > = > Unfortunately this doesn't work, because it is a already-legal method > call on a method stored in the constant called `DateTimeImmutable`. See: > https://3v4l.org/3khkT#veol ohhh then, continuing on bikeshedding, I think I still prefer `?::DateTimeImmut= able->format("c")` or `(? as DateTimeImmutable)->format("c")` as Larry men= tioned. `(DateTimeImmutable)?->format("c")` feels a bit weird. Reminds me too much= of the null-safe operator. > = > > I noticed `?->method(?)` was considered; evne if it was possible, I > > would prefer if the type was explict, as you may want to use an > > interface name (or a union type, etc.) too > = > = > Union types would likely be unsupported either way, since multiple > members of the union could have incompatible signatures for the same > = They could have incompatible signatures, yes, but they also could have com= patible ones too. It's not a deal breaker. I don't imagine needing this in= practice. But I don't see why the language would prevent that; I can alre= ady make that mistake with short closures or any methods. For me, it's the= role of the static analyzer to tell me if I made such a mistake (or runti= me errors ^^). = > Interfaces are fully supported with the currently proposed > syntax (it's explicitly mentioned in the RFC). > = > Best regards > Tim D=C3=BCsterhus -----------------------9677d71739fa917fbf6ceb4ecbee0bd9 Content-Type: application/pgp-keys; filename="publickey - mathieu@rochette.cc - 0x8D30BA0E.asc"; name="publickey - mathieu@rochette.cc - 0x8D30BA0E.asc" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="publickey - mathieu@rochette.cc - 0x8D30BA0E.asc"; name="publickey - mathieu@rochette.cc - 0x8D30BA0E.asc" LS0tLS1CRUdJTiBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0tCgp4ak1FWVFLZkNoWUpLd1lCQkFI YVJ3OEJBUWRBa1BDZHlabHI5bmZBMHdJcUJXSGl6dnRQNTQ5MTFQWDgKdkowcGp4T0JabHJOS1cx aGRHaHBaWFZBY205amFHVjBkR1V1WTJNZ1BHMWhkR2hwWlhWQWNtOWphR1YwCmRHVXVZMk0rd284 RUVCWUtBQ0FGQW1FQ253b0dDd2tIQ0FNQ0JCVUlDZ0lFRmdJQkFBSVpBUUliQXdJZQpBUUFoQ1JE SWdrVGc3MTk3UnhZaEJJMHd1ZzZMaWxERVUvYVBPY2lDUk9EdlgzdEh1Z29CQUtTcFdzNmcKWVdh bUU5Wkc5WGV5V2VxQVFLUnZwaUtJdnNoQzRlckNvNVVEQVA5VGNHMW5rWERiYTlIOTRpM2Y4Q3ZY CkZhK2kxM1ljTktUZU55ZllaUFFnQmM0NEJHRUNud29TQ2lzR0FRUUJsMVVCQlFFQkIwQ0hrOFBU dWJOMQpkR0Z6WjlscFVKYW5KbjA1RDJmaUhZOGY1N3QzeGxheUlnTUJDQWZDZUFRWUZnZ0FDUVVD WVFLZkNnSWIKREFBaENSRElna1RnNzE5N1J4WWhCSTB3dWc2TGlsREVVL2FQT2NpQ1JPRHZYM3RI dGNBQS8xWlNrVFVKCkU1TzU4bUR5VTNSeFFyVjNVQVA3U3BaamN1T0pKSTRTRzE5TUFQOXlIU3Rq dDJXa3IxS0o5c0VNeXY5aQprb0xNS2VZa3Q5RXlyUFM5bDdsUkRnPT0KPTNIZE8KLS0tLS1FTkQg UEdQIFBVQkxJQyBLRVkgQkxPQ0stLS0tLQo= -----------------------9677d71739fa917fbf6ceb4ecbee0bd9-- --------e2452454a84a44a90add1a588128e9e96590676bcadca11aa281397273445635 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: ProtonMail wrsEARYKAG0FgmlzcjoJEMiCRODvX3tHRRQAAAAAABwAIHNhbHRAbm90YXRp b25zLm9wZW5wZ3Bqcy5vcmfeAbrAMn7myx6UYDSPyfT2rtfix9ThVOqVw6Kc aXm3ZhYhBI0wug6LilDEU/aPOciCRODvX3tHAABXZgD7BFG0ddr8Jcemjtng /mK+sGKsA9sMt+Yy3zGP/h7K+z8A/2RoZs0b/1F1gX5sheuq4A4gzyZCQOpL oufjMMoBXrUL =xP+p -----END PGP SIGNATURE----- --------e2452454a84a44a90add1a588128e9e96590676bcadca11aa281397273445635--