Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126941 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 13E621ADAB7 for ; Tue, 25 Mar 2025 20:42:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1742935217; bh=maIBCEQYf+Cn3UK3EWmWpwyS517Y5sSY0fCoeVLEacQ=; h=Date:From:To:Subject:In-Reply-To:References:From; b=gQ/l0sC9fuP01vFzWaLp9ElVUYyj2lB3r/EYpNyl9KYRQMcfZOj61eSfs9NEVf/s7 Da2NkaV5QpMhB4TfWbp7SzfCzCl69o4jcFHyilxWBrkmnr8jUa/Ip5X+u5fe1X0CAW hYjWQAkTaJ0w/sAtWft1/rTGoll3tAu6td6CSdqYTUlD0E57bz5WJJsby093q4ciBw D6RSjaC3i5Bt9HWS2MLwm0xg1SP2l5Y46T0k7avLojySea0U2yb+oUSO7mCqR00rsr ufnbYnBDwGBbyFIA81nrdlFzZbZppbI2PnrYdRA6DmFxvND/4a7kdUPLJyYJFVyb9h TW/neJEjdZg9A== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C91DF1804D1 for ; Tue, 25 Mar 2025 20:40:15 +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, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from fhigh-b5-smtp.messagingengine.com (fhigh-b5-smtp.messagingengine.com [202.12.124.156]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 25 Mar 2025 20:40:13 +0000 (UTC) Received: from phl-compute-12.internal (phl-compute-12.phl.internal [10.202.2.52]) by mailfhigh.stl.internal (Postfix) with ESMTP id DAE8B254011D for ; Tue, 25 Mar 2025 16:42:41 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-12.internal (MEProxy); Tue, 25 Mar 2025 16:42:41 -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=fm2; t=1742935361; x=1743021761; bh=maIBCEQYf+Cn3UK3EWmWpwyS517Y5sSY0fCoeVLEacQ=; b= gR2bd9kWPWQL3lUBlnJLRViT4lPfC21zQvGlll2N2jyhpQH/1WvQVFXO4biM8Wlr ogJADQ0CAeYLBzeKz/JcIGWo84LwMGhV/u+UaQfbIqj5yfwBzgCKS8WwGDuBNKCN IKxdXU4uqnUQNXaff9hnem7bWIXmpIR+K7lAvAvFyfKwe99ZC4XjQm/BTdLgVtYm FIu5/dOFEMNQZQMbgfGx9KwNIgpjRu9yySxSbbKSlVNIECfqONJI0lc3KoIciTIM Fa423GBu/vu4+CtPzzKazxx2Hm1efPwadLJsyXa/VJNNzQAOxIDzdfFpNwCqLnW2 E4yyT+7Xi5CPUsvVn2VyHw== 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=1742935361; x=1743021761; bh=m aIBCEQYf+Cn3UK3EWmWpwyS517Y5sSY0fCoeVLEacQ=; b=Ul0EaPkB9oA6mGGl0 fVnc/biezTT1Ua7VmAvdFRCOwb83qUcoSQkRdsskNuurOynu++11O8nPSuyF9960 lv2aIr1m899kvoRUbXM7xN3tTtEVegsSYBRt+LhN2hkqtSfnF5ac3aw4x/HdG9Yz 9N4bsd2/Z5Lbh4B7MHTFyBjLo+kts+O7Gg1xWYH5JJ0NbTKF+Zztksc0Bm7n8DE0 1ytHdFO3AKk2de6Uh244Gs8d3Hf8Ew7yOTffS5RkIVRsXCXEHW2Gc9C3tdsZfnLc QnY5hRddbDVkIE0bgwEpFAA7OiMFqU/DyqqddhNYWacQUjtLsODy2mcryZHRolnN reYFw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduieefieegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpeffhf fvufgfjghfkfggtgfgsehtqhhmtddtreejnecuhfhrohhmpedftfhofigrnhcuvfhomhhm ihhnshculgfkoffuohfrngdfuceoihhmshhophdrphhhphesrhifvggtrdgtohdruhhkqe enucggtffrrghtthgvrhhnpeehleffteeigfevudetfedugedtudevledugeeugeelheei hfehgfdtkeevvefgleenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehimhhsohhprdhphhhpsehrfigvtgdrtghordhukhdpnhgspghrtghpthht ohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepihhnthgvrhhnrghlsheslh hishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Tue, 25 Mar 2025 16:42:40 -0400 (EDT) Date: Tue, 25 Mar 2025 20:42:39 +0000 To: internals@lists.php.net Subject: Re: [PHP-DEV] [RFC] [Discussion] Never parameters User-Agent: K-9 Mail for Android In-Reply-To: References: Message-ID: 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 25 March 2025 18:14:21 GMT, Daniel Scherzer wrote: >On Tue, Mar 25, 2025 at 11:01=E2=80=AFAM Rowan Tommins [IMSoP] >wrote: > >> >> I don't think the language should pretend to support something that it >> doesn't >> > >I don't see what the pretending is here - the engine supports declaring >that a method must accept a parameter but makes no promises about the typ= e >of that parameter I guess I just struggle to make such a declaration have any meaning; it fe= els like a philosophical statement rather than a practical one=2E Perhaps "pretend" was too strong in this case; I was mentally comparing it= to Python's unenforced type hints, which are only as reliable as comments;= and the occasional suggestion of doing the same in PHP with generic declar= ations (built-in syntax with no built-in behaviour, which would be a hard N= o from me)=2E If I assert($foo instanceof InterfaceUsingNever), I can't actually do anyt= hing useful with the promised method; I can only call it if I either read t= he unenforced rules (e=2Eg=2E in docblocks and comments), or assert($foo in= stanceof SomeConcreteImplementation) instead=2E In the context of this thread, I can see that the examples are logically c= onsistent, but if I just saw one in the wild, I'd just be scratching my hea= d what it means to require that no values are acceptable=2E=20 And I've seen plenty of junior devs struggle with simple things like the d= ifference between "nullable" and "optional", so I worry that making the typ= e system too rich will lose PHP its reputation as an approachable language= =2E It's possible I'd react less strongly if a keyword was chosen that made mo= re sense in context, although I'm not sure what that would be=2E public function foo(int $a, must_override $b); That's not quite right, I think=2E Rowan Tommins [IMSoP]