Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125033 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 1ABD61A00BD for ; Sat, 17 Aug 2024 22:20:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1723933353; bh=KiYp0R013115/Q340GcU9o4oLDG1GyTsGqCFjWPApGQ=; h=Date:From:To:Subject:In-Reply-To:References:From; b=A6Z45mlMYb67VhiamlVO3L96tIvQC3kF979//NS5SjQy7bq7Pq5u9y46Qy4tE4tZj 2fde8ZuqllUgziPRcM8IpYE/gTKJ5NtPWkWEYGt88I9ehjtvDoHQQkil/hxc9MIriF Lf9xRBkvhM7+q2/DkZQWzG202nsSgMMfcvcOZDB8ePWgs9Wk+XxPkHEPe1iuI34uIp 8uc85wuYBsY5jl/lGONi5Bw/qp5XjRxMecBcSzn1mUfGpEMe1pTq+MW1GPXDXzxMUt M2rGmjD+2cA+6fDWMBs/kEEuYrfHU19PIVEucLWiSNZNR+6ku9vUeT8MfWFEn3EdIP jbCro+7YR6gtg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0504A18006D for ; Sat, 17 Aug 2024 22:22:33 +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=-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.0 X-Spam-Virus: No X-Envelope-From: Received: from fout6-smtp.messagingengine.com (fout6-smtp.messagingengine.com [103.168.172.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 ; Sat, 17 Aug 2024 22:22:32 +0000 (UTC) Received: from phl-compute-05.internal (phl-compute-05.nyi.internal [10.202.2.45]) by mailfout.nyi.internal (Postfix) with ESMTP id C5C621387A9B for ; Sat, 17 Aug 2024 18:20:43 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Sat, 17 Aug 2024 18:20:43 -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=fm3; t=1723933243; x=1724019643; bh=KiYp0R013115/Q340GcU9o4oLDG1GyTsGqCFjWPApGQ=; b= KUYkxajjA97Gz+kUx/ZofIWL2z1RLEpVJYPCNcr+UDUkaoFvkdc6AjRU6eBXMijW iJWAtLXlBqFWKU2XZ1myMeuJ20+qbH6veTlXQaGDiJup6VvLKzbMxLDFohJ7C9CL 3cC8h7yvggIz0Vx9leJ1kLWfpMSzP3vRzkaUsOrqdUyyNzScEe4oi8+H5Vd1ZL4k Upor3s5wLHczC1+mDU8HwodfPYzxFvvK88BlpDLkKj47+FIMSzvuU/2XSByGDnTJ zIOUlUisZZGZH/I9elS6RGSxSRGctOfxUFW4pQPslsx3SfwSM9YesrJ5ol4ZfTLb Vnlfq97wFti7RuYLL1Hehw== 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-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1723933243; x= 1724019643; bh=KiYp0R013115/Q340GcU9o4oLDG1GyTsGqCFjWPApGQ=; b=S HadxoLH1u2Rub4cwrS+C4miEs5uNYK/mjxtEGCvhT9HPmZG5bbLFhtkzdYJHMWjs A6wxonYqyMgZB7cYTJLl6fQT4X3vapqNfU/PrBorya0Wh6GX52uTsk3eQumcwHx4 Fhh4Ff9vm3Sa6ubzGJF9bCtYvdN+zL+qPUhV9C/5GZWxXRX6GJC4Xv6w+/CT/JSW CfORGThfnqaY12bgooRktDeT0IGtrmthbw+GCcxxryHVa+X4aXUmOVl1jwr4PZKG nxbR3ufj8Jj7LAtO9BMluhTQQwi5wPRALKQjQ4Zry7nKozAVlLRy4/J/rOlv3V7N g3v3+ULaicO1mZAS3UqmQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudduuddgtdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuf gfjghfkfggtgfgsehtqhhmtddtreejnecuhfhrohhmpedftfhofigrnhcuvfhomhhmihhn shculgfkoffuohfrngdfuceoihhmshhophdrphhhphesrhifvggtrdgtohdruhhkqeenuc ggtffrrghtthgvrhhnpeehleffteeigfevudetfedugedtudevledugeeugeelheeihfeh gfdtkeevvefgleenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehimhhsohhprdhphhhpsehrfigvtgdrtghordhukhdpnhgspghrtghpthhtohep uddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepihhnthgvrhhnrghlsheslhhish htshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Sat, 17 Aug 2024 18:20:43 -0400 (EDT) Date: Sat, 17 Aug 2024 23:20:40 +0100 To: internals@lists.php.net Subject: Re: [PHP-DEV] String enums & __toString() User-Agent: K-9 Mail for Android In-Reply-To: <428B8247-59F1-4987-B9F7-0EE7F5F70717@getmailspring.com> References: <7082DD61-A257-4B3D-A49E-9CB32A560CDA@rwec.co.uk> <428B8247-59F1-4987-B9F7-0EE7F5F70717@getmailspring.com> Message-ID: <89FE5666-8E5F-42B1-810E-53D55D97D038@rwec.co.uk> Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net 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 17 August 2024 21:27:59 BST, John Coggeshall wr= ote: > >I don't think it's without purpose=2E=2E=2E what it should be for is to a= llow developers to make flexible APIs where they can type-hint string|Strin= gable and the user of the API doesn't have to worry about it=2E My view is that the user *should* have to think about it - if what the API= needs is a string, tell me that, and I'll pick a method that returns a rel= evant string=2E I also think it's weird that Stringable is a magic implicit interface=2E I= f it makes sense at all, surely it should be a pseudo-type like callable, a= nd also accept int and float values, since they can be cast to string too= =2E But maybe I shouldn't have said anything, because I've had this conversati= on before and it generally just leads to agreeing to disagree=2E Plenty of = people seem to think __toString and Stringable are a good idea, so I guess = I'll just leave y'all to it=2E=20 Regards, Rowan Tommins [IMSoP]