Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130486 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 F24CD1A00BC for ; Mon, 30 Mar 2026 07:37:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1774856255; bh=bkan5UzAAzJhWr3DpNgd19zFjqa7REwLibl4oUFVTtk=; h=Date:From:To:Subject:In-Reply-To:References:From; b=VP5EjDssuJS5o/b+BIPwQ2YICaZxDp5WTw6YC2rZYDc69gWCa/46iNjPcmwaRcZAg gu41XnkLobPoTLq0HiklT8zuLvHWGWSV9rSALhL6bhEvfVxUAXRYv62y+/KK8fAAtT 17hglFTJN26WSjqxcpBr2NmJs+GRmzbgOwU1ZUHSoJAjQJXr9ycDR99xi+ilSHVuw8 /q0w5lolk1jccqBwWmCc6IclY5T9fkw4LXTc/AF8ubNd8uk1ftzpVvhL8Kyr26BuBg tn1jHAWEWAPgeEl8l++DWKR0wkFKIUFGOc4fZaf7RyYXuZ2mvZByKZ32ynXb8PY0kF eVdLyUl7lFCfQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id AF0EF180078 for ; Mon, 30 Mar 2026 07:37:34 +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-b2-smtp.messagingengine.com (fout-b2-smtp.messagingengine.com [202.12.124.145]) (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 ; Mon, 30 Mar 2026 07:37:29 +0000 (UTC) Received: from phl-compute-12.internal (phl-compute-12.internal [10.202.2.52]) by mailfout.stl.internal (Postfix) with ESMTP id AED2B1D002BE for ; Mon, 30 Mar 2026 03:37:23 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-12.internal (MEProxy); Mon, 30 Mar 2026 03:37:23 -0400 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=fm1; t=1774856243; x=1774942643; bh=bkan5UzAAzJhWr3DpNgd19zFjqa7REwLibl4oUFVTtk=; b= T718u2G3CTEOqNIwMeAIbCHhFIFm4D0cM+Tugp0TRH+aDahsRUSjGU2cR2jqO3Ry T1IibYa3+p5E+99rszAOvud6MNHx8TehjhXzTDZ2RktPgC8TchwwGr+amRYcWWzc jrsoMLVFJUk2nynP+tZ0m0YVgVGCIC7UxerV1ylglZIKw9Xqzqjxv4JqrOSOeyBB IZHNb1c8SkGJKi3W0/7++MsP3FdAB/7W9PKnxpkA8ScOqm448eX3B5RiVqwCS+r8 BX4ws+oWBg7nObtXq136FvfgFIevHUCSWLjgdyCItXbVgR3c2KKjm3ZAkY4IpYHs Vs4hPUQAqgwr5obZ/Vui+Q== 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=fm1; t=1774856243; x=1774942643; bh=b kan5UzAAzJhWr3DpNgd19zFjqa7REwLibl4oUFVTtk=; b=rNLVUpTTyVLbsqu/M wcKZkhp0idLcH99CUtodAN9Z+RT+dA/k4vOP44+1UnnH1omZu2DXBM8yuo50Zfxp 4Rofz9vvzrb5KiLUfyGwDRaxhwvdt0/GvDcQu+vh8XF+Bc1REHuiJR09oXMSzFyk Y/AydtdVUjr50wU0evugIw0ou2G6wkDYG4ATPxQtdTyFL1VrG2w0Z1TSdZEjQ8zI PUXj+x3QLjJcQwmr3KXSeuFtGuvj4rKTyGqT6H5zj2/cfZCJi9sfCCRgUIVS0Mxh Yb0XrUdAGKh+1wfJxb0EYu4DQHxcXykQehmu0da8zu2XUQXtY4Sb5StAShQdGlqU +ljTw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdeffeekgedtucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucenucfjughrpeffhffvufgfjghfkfggtgfgsehtqhhmtd dtreejnecuhfhrohhmpedftfhofigrnhcuvfhomhhmihhnshculgfkoffuohfrngdfuceo ihhmshhophdrphhhphesrhifvggtrdgtohdruhhkqeenucggtffrrghtthgvrhhnpeehle ffteeigfevudetfedugedtudevledugeeugeelheeihfehgfdtkeevvefgleenucevlhhu shhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehimhhsohhprdhphh hpsehrfigvtgdrtghordhukhdpnhgspghrtghpthhtohepuddpmhhouggvpehsmhhtphho uhhtpdhrtghpthhtohepihhnthgvrhhnrghlsheslhhishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Mon, 30 Mar 2026 03:37:22 -0400 (EDT) Date: Mon, 30 Mar 2026 08:37:19 +0100 To: internals@lists.php.net Subject: Re: [PHP-DEV] RFC proposal: Invokable interface User-Agent: K-9 Mail for Android In-Reply-To: References: <5ce1f5a3-1ad5-4cc7-8c6e-93170af28ef4@sandfox.me> Message-ID: <9018E616-F5BA-4E94-B2B0-1513A2365286@rwec.co.uk> Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") On 30 March 2026 01:32:24 BST, Osama Aldemeery wrot= e: >The only difference is that __toString() has a fixed signature, so >Stringable can enforce it through a normal interface declaration=2E >__invoke() doesn't >have a fixed signature, so Invokable uses an enforcement handler instead= =2E >Different mechanism, same contract=2E The difference is caused by the >variable signature, not by any fundamental difference in what the interfa= ce >represents=2E I think that is a very fundamental difference=2E Given $foo instanceof Stringable, the user knows they can write (string)$f= oo and the object will do something - that's already a pretty weak contract= , in my eyes, but it is a contract=2E Given $foo instanceof Invokable, the user knows even less=2E They know the= y can invoke the object somehow, but there's a fair chance that $foo() will= fail because of mandatory parameters=2E Can you give an example where this very loose contract would be useful? Regards, Rowan Tommins [IMSoP]