Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129862 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 380B81A00BC for ; Thu, 22 Jan 2026 16:26:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1769099187; bh=XYe/8pIIhl+naE7hYbCLrPAfC8xyR7NYfxCJOexsAnY=; h=Date:Subject:To:References:From:In-Reply-To:From; b=WyNGCg78JZjpXGZeZdxGMjELhxgl6ZQhjWBz1aDoG6UNhXzR38yInCuCU4AuuEvI1 tvg09HkQuVz21wivH6/flb3ULLad8GXXHz+dE8VmsbKL+9tWyPoUis52WwWUMjzHbI uD8cXjFXsVW/8JOnE5/hFKKA+264NP0jTGb9UFa5rvxZx+dOFGMrI/9EIMya7+NPb5 SvDtE/8vsAay8yLZo8mPqhInjdxmbfOfTW0hJXDWWfbzetopSqMEUjGBhRgJjt67gy 0jhOzAcVNzyismOHlZblUKdbzw/Ej+TRVhSUeinb2dZQwZi+gekv9VLJVlKmcabxhE V5VAIgIGzsqXQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4B64D1809E9 for ; Thu, 22 Jan 2026 16:26:26 +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_MISSING,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 fout-b3-smtp.messagingengine.com (fout-b3-smtp.messagingengine.com [202.12.124.146]) (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 16:26:26 +0000 (UTC) Received: from phl-compute-10.internal (phl-compute-10.internal [10.202.2.50]) by mailfout.stl.internal (Postfix) with ESMTP id E02A81D00138 for ; Thu, 22 Jan 2026 11:26:20 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-10.internal (MEProxy); Thu, 22 Jan 2026 11:26:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rwec.co.uk; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1769099180; x=1769185580; bh=D0zTyWo2uc4+Uu80YYItlcXthj0wB5qelVnTKNPFncY=; b= e98zTaO3mSECfLx89JABcxDDDEMuCVvGXD8QwwSG4ZY1IARUtDAFgEVncEAQGkhg faSw7ElCvyXjVaFlShRIFUVIdx7PsTL8Ifnu8FA8zoqaeuCUtAH2b7FpPFShV5M9 3m2IyKw/RBBVOgSnEw5Q2G0aXnGHJ4Qo2hvCKEUXyNQMJrirAWfUZs7OYLIE9c8H vH3Y6FIry7TMeUircOSjFUyHLWbu7aAZN6gN9zoR1tcTgjT3/rd9Nk2oXCsvaI9m d0EV/GzLanb6SVr83srueTIhGOzvfWXZyFpIzYjAT2MOE/WAOjfbwN8M2RG21MYO 0694ivWwqYhuAzWvlFa2jw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1769099180; x=1769185580; bh=D 0zTyWo2uc4+Uu80YYItlcXthj0wB5qelVnTKNPFncY=; b=ku/InZJOzliPF2M39 xUiJTAUXNeUUc+v43+1sobxnIp8jqtx6yfAHxns6IWqkPTCfr/bXKadwMuzDdqPb qRAJtm81QadmMSXJ79L2eXjI5p/A6DISTeygRZl7SDxtcN2ocv0qsml+JAKynaKk 8BmYI4gx1ZI/E3tv1MoQjvAY0A7M94pmMZOSTxIG6YSNS56gYZIhluwm1ULM0O3R Yri/lQqgLyLaMb0tDGvrx2MTisIyEbOdEU0IlUsYeOsTQ0iJ0h4HApqKsqxBzdvj 14pFq62zLgotE1SJoTST9jePeHploJcSxl9mefJa8bRtwTwrndjpxsL9zWnPFyiP LQW2Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddugeeiieegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtkeertd dtvdejnecuhfhrohhmpedftfhofigrnhcuvfhomhhmihhnshculgfkoffuohfrngdfuceo ihhmshhophdrphhhphesrhifvggtrdgtohdruhhkqeenucggtffrrghtthgvrhhnpeffke evudffuddvheejvdefkeelfedtudegfeehjeduheegieduffeggeegveefheenucevlhhu shhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehimhhsohhprdhphh hpsehrfigvtgdrtghordhukhdpnhgspghrtghpthhtohepuddpmhhouggvpehsmhhtphho uhhtpdhrtghpthhtohepihhnthgvrhhnrghlsheslhhishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Thu, 22 Jan 2026 11:26:20 -0500 (EST) Message-ID: Date: Thu, 22 Jan 2026 16:26:19 +0000 Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] [RFC] Partial Function Application for instance of non-static methods ("$this") To: internals@lists.php.net References: <64953ec741a4c6609519e1878ad37b54@bastelstu.be> <253ee811-0c1d-7eab-4c36-38607401aaf6@php.net> <28461544eb11b41dce7c7563ad879e63@bastelstu.be> Content-Language: en-GB In-Reply-To: <28461544eb11b41dce7c7563ad879e63@bastelstu.be> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") On 22/01/2026 16:08, Tim Düsterhus wrote: > Yes, it certainly requires some getting used to it. It's the best we > could come up with, but if there are any better suggestions, we're > open to hearing those. I'd like to note the “Rejected Features” > section, since it lists some non-workable alternatives we considered. Looking at this: > PHP itself already has "ALGOL-style" declarations, for "const", "global", and "static". I'm reminded of placeholders in PostgreSQL; the type is needed to choose overloaded functions and operators, so this doesn't compile (without extra metadata): Select do_something(?) as result Instead, you can insert a dummy cast to indicate the type: Select do_something(?::int) as result The PHP equivalent would be something like this: $f = (DateTimeImmutable)?->format('c'); Or, slightly more readable but less consistent with casts: $f = (? as DateTimeImmutable)->format('c'); That doesn't solve the second part of the problem though: > It would also not allow to reorder the parameters in the resulting Closure, which is an explicit feature of Partial Function Application. I thought I'd throw it out there anyway in case it stimulates any other ideas. -- Rowan Tommins [IMSoP]