Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129871 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 C22C31A00BC for ; Thu, 22 Jan 2026 17:30:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1769103021; bh=ygjfjC2xwBD54QkkKvzAwMTnhVjIWTR1npeCziCJTfk=; h=Date:To:From:Cc:Subject:In-Reply-To:References:From; b=Fi50Rn47OFtIJUkJpl0QCyiApQFCh+MeXAqjty0Z0YN5qt1oIY7RLVgRAdZ7VtH6h WyTuzM8o9jpwSbAHWvkoxnjmGhqU8qKLNUL7v023xzv3rlyheNFjYtt8aZKUPtSRde qzaZJzCUlrv7nMao1E7NW/Myc/MmHNiEZQ8EMHVoAVWGMCfmVeolb7+ldjigatVxKY n8rxzoR2Gvy36o3pA5+O3HHQWEhJ0sGb4ECBJrjx/oo95x+pb5j7fWGskgGnMbuHyD 0SrkdViCIX4Lg6mNK4m2TqZ2qhhnUdDjU75ZtLFDWoS/FhbY7wZgPdAWzr8m6FHXZ1 FDlsx1nqgMWhw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7BC6F180503 for ; Thu, 22 Jan 2026 17:30:15 +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, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-10625.protonmail.ch (mail-10625.protonmail.ch [79.135.106.25]) (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 ; Thu, 22 Jan 2026 17:30:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rochette.cc; s=protonmail3; t=1769103006; x=1769362206; bh=Ay2AheCtHdWQae+6j61lTKv1u16Mo9zZZABgvGzpVCM=; 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=COo2hWkwhrt/UB0wNMWp3xWL355hrG7UCJQqRkFIw+MCsnJ4ZD7wlophoYbDrPNaX jFG7KBvbw2yHHdWdIpkVouXpiaRWqiITUvvII1x7brq+KUCM8IxIWQJnL7/sGnLX+c y9j3mdWPMxab5Xw5oNnPFU8wdtnUmFBokfSMVES86zUB8p/eNmCIzUNdX7bbSrITI9 ZuSlAri7fHj41UsIe5KYK5LsRKmIsJlg8hFdIoVMsEl4cE30voWsz5dXIp2iNjaHnz zQv0N8Fdi2HEB0R2hSrv1zLaOVkETrccr6AXsSSJ2lkS4RIWF5AdjCu4ZtGYY2aQas 0KmPk3FB1Q7Bw== Date: Thu, 22 Jan 2026 17:30:03 +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: <64953ec741a4c6609519e1878ad37b54@bastelstu.be> References: <64953ec741a4c6609519e1878ad37b54@bastelstu.be> Feedback-ID: 37040780:user:proton X-Pm-Message-ID: 7b83846440939f26d648f5f28f0dea71ea5f1e86 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="------363b87c335b8720dd8f65bad0e861eb4dc8cb265be0ae5a2c66277f32003ce02"; charset=utf-8 From: mathieu@rochette.cc (Mathieu Rochette) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------363b87c335b8720dd8f65bad0e861eb4dc8cb265be0ae5a2c66277f32003ce02 Content-Type: multipart/mixed;boundary=---------------------9fbe91f471408fb15f0dcb49256ba34a -----------------------9fbe91f471408fb15f0dcb49256ba34a Content-Transfer-Encoding: quoted-printable Content-Type: text/plain;charset=utf-8 On Thursday, January 22nd, 2026 at 10:52, Tim D=C3=BCsterhus wrote: > Hi > = > Arnaud and I would like to start discussion on our RFC =E2=80=9CPartial = Function > Application for instance of non-static methods ("$this")=E2=80=9D which = is > intended to round-off the Partial Function Application RFC that was > accepted recently: > = > https://wiki.php.net/rfc/partial_function_application_this > = Hi! I often whished something like this existed :) Didn't get trough to sugges= t it because I wasn't sure of the syntax either (and lazyness) still, my syntax suggestions: array_map(DateTimeImmutable->format("c"), $dates); I understand this doesn't allow reordeing though, but it feels so much bet= ter and I expect would be what's needed for most cases that I hope somethi= ng like this could work. and an opt-in mechanic to reorder could be introduced for that use case. t= he previous suggestion could be a shortcut for: array_map(?::DateTimeImmutable->format("c"), $dates); and a separate improvement to PFA could add support for picking arguments = by name or position: array_find(?key::SomeObject->hasMatchingValue(?), $array); array_find(?2::SomeObject->hasMatchingValue(?), $array); 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 regards, Mathieu Rochette > Best regards > Tim D=C3=BCsterhus -----------------------9fbe91f471408fb15f0dcb49256ba34a 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= -----------------------9fbe91f471408fb15f0dcb49256ba34a-- --------363b87c335b8720dd8f65bad0e861eb4dc8cb265be0ae5a2c66277f32003ce02 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: ProtonMail wrsEARYKAG0FgmlyXpEJEMiCRODvX3tHRRQAAAAAABwAIHNhbHRAbm90YXRp b25zLm9wZW5wZ3Bqcy5vcmdumCn09lgkl2rzjfuCXDijGZokV6nUm34KOl9S DNtOwhYhBI0wug6LilDEU/aPOciCRODvX3tHAAAnIQEAl0rQFj97oC0T1dDI OoSloKKMmPcjxPfAGOnO6q2QiBcBAIvgEPA6xDIwl7nHFIXntsTAwoOSmAnn o+uqVZCuBNUD =ILFI -----END PGP SIGNATURE----- --------363b87c335b8720dd8f65bad0e861eb4dc8cb265be0ae5a2c66277f32003ce02--