Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127039 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 qa.php.net (Postfix) with ESMTPS id 385201A00BC for ; Fri, 4 Apr 2025 04:40:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1743741512; bh=6OkU4Iajvl9BtLCNZeTwjua402WFnhve++DVacJxo0Q=; h=Date:From:To:In-Reply-To:References:Subject:From; b=OUkrZWJqi7RImJKQp9wuk87lBiv0U2YbHjYwZ9dQ6pTEar6nHQ2bUS15HvapFfCIA nrZ/6BOTKgVm1JEjysT19zaUQYwjL5gleY7ecc1VLDV2AOuUP0CSsVp7WHnVS2UoIX Rvg4ZQ6iiVBcjBuQtpym7PHG0pHrDURqBqXQF8Crvr0tvqqE7qDN4D5JFrZpRqoWvr kVvvIGWydBK/qmG8UNeWssm74/aOkpYg+3WxeHLJFZ/VO7P2QUa5p//Js/fV23rPhN 3IaaqShkDIfKtsYCCa3GuKF7oV9TG21ZDQ6l8rrmwvt0X7Rej5m8RyVHkrH0a1Xmhj VCzKFkCdJcEcw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2EAD41801EB for ; Fri, 4 Apr 2025 04:38:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from fout-b6-smtp.messagingengine.com (fout-b6-smtp.messagingengine.com [202.12.124.149]) (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, 4 Apr 2025 04:38:27 +0000 (UTC) Received: from phl-compute-12.internal (phl-compute-12.phl.internal [10.202.2.52]) by mailfout.stl.internal (Postfix) with ESMTP id 9BC37114019B for ; Fri, 4 Apr 2025 00:40:53 -0400 (EDT) Received: from phl-imap-06 ([10.202.2.83]) by phl-compute-12.internal (MEProxy); Fri, 04 Apr 2025 00:40:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; 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=1743741653; x=1743828053; bh=NBwI5oUaoyrqkxrUzHjW8 l3gwHFadOw/odmzcb01/b8=; b=qkVxKNtIofysXGoGIArtqJl7+mcnXkT/Lb0qj JhcH4uWUvxakMx+PYhS12nhO6qXoBA6Qf2Kf85VBXQNbH8d2wn3tQkz9Hl+bpIyh l+lWTrcCP5wlBqXCShLsBtRXBm+quVQ41wLb+lcdzTo4dJ2wJI2d2ndM5ZPeohA6 Ogxj0VP/mnQjN/WwxFp95A8e6ar7SxdGi9j+PUyeItc3Pn1fxIRuhPMCEH6cOqkx 9VZJoppg88U3xLg3up1qZgIN0xEjTL3oQsdgTZH070JAD7CZMstx8CpEvl6vgvF7 hGUKyAy4v5Dhtwom814xjB86HwBVlJmp3ieFgXMF+Twf7hUrg== 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=1743741653; x=1743828053; bh=N BwI5oUaoyrqkxrUzHjW8l3gwHFadOw/odmzcb01/b8=; b=Lov3WMVSe3xQLkVqe 2pvcQ9y0qaQ8NVez5LtpNg0BuWofz7f3iAiAMRWfLNaKukYgAV/002I2J2uBWc6k 9GF9V1jrkUpsl2TkaO57jfxQJ69RDuAXQitsOaZ8D2cjI1Sjv9yNXMGZoAS3bkQn hZ6TrxhAVBfMTenqRWP45gCRLsZFLCP7bx26fVMraLrqa0v3k3ijcHV/gGDtiCWy VMmfquoQKMo0q8bw7NVL8x3EI9Nhw+KMwubBC0+sH8kUm7l4eajr/vBvYHgzTYBC q3JkloaipKAx+ycSdZshexTW17+K+AsTYpAUFVPpp537E8SYMaQuH02fr5H9plFG NHv8g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduledthedtucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhepofggfffhvffkjghfufgtgfesthejredtredt tdenucfhrhhomhepfdfnrghrrhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrh hfihgvlhguthgvtghhrdgtohhmqeenucggtffrrghtthgvrhhnpefgfeefvdetiedvgeeu ledtteehgfegteetieevfeeuhfetteegueehgfeivddtgeenucffohhmrghinhepvgigth gvrhhnrghlshdrihhonecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghi lhhfrhhomheplhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhmpdhnsggprhgtph htthhopedupdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehinhhtvghrnhgrlhhs sehlihhsthhsrdhphhhprdhnvght X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 3C04B29C0072; Fri, 4 Apr 2025 00:40:53 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 X-ThreadId: Ta1895ca08ef5cf99 Date: Thu, 03 Apr 2025 23:40:32 -0500 To: "php internals" Message-ID: <58b8ea3b-6854-4f38-993a-c33f9d1b69bb@app.fastmail.com> In-Reply-To: References: Subject: Re: [PHP-DEV] Uniform Function Call Syntax Content-Type: text/plain Content-Transfer-Encoding: 7bit From: larry@garfieldtech.com ("Larry Garfield") On Thu, Apr 3, 2025, at 8:52 PM, Yakov Lipkovich wrote: > Hello, > > I would like to gather interest in adding Uniform Function Call Syntax > (UFCS) to the PHP language. In short, it allows to call any static > function `f($a)` as `$a->f(...)`. The `...` is required because not all > functions have the desired parameter in the first position. Outlined > below are some benefits of this syntax. Welcome. I recommend having a look at the Pipes thread[1], especially the last week or so of messages, where we're discussing something very close to this. My most recent message touches on this as well toward the end. In short, it's not realistic to "bolt on" such a universal approach to a language as mature as PHP. However, using pipes, partial application, and/or extension functions we can get to something that feels very similar, and that's already being worked on. (More details in that thread.) Cheers. --Larry Garfield [1] https://externals.io/message/126318