Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126869 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 AA3971A00BC for ; Thu, 20 Mar 2025 16:24:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1742487717; bh=g/H0CGub31f+jUAnBni7p102lQaQPfPdJUMumpX2L2M=; h=Date:To:From:Cc:Subject:In-Reply-To:References:From; b=ZwK4oYQ2ZCMl5sqpd5xBLsBq6wYiGRg/98zzSCReTVXn90QnPIdGxjr8ZyKR8gc27 O8+p6G+Mj4/ExABFAFxZfLpztovcP8d4acq4eAGyTMT17xVI0hdBTwrvVl3xskiZPU YOhxLREftIq7UOqb+uymkrT2xjLVBL+ddZrb3Fe73Hf5ZHbOfI049guUyg3jOvP7Vv VecBzP89PkQeZKIrl7+hHaqWZN/LUsPxQaehwqO8yN7MEhZVKy66ZCpZX94wP16CHJ 9XOJCnuH30m9lIDjyqYateK5c9ydVU175mtZ1PdlY91aqcG8ZdG2jxjeMHqeUvP5de L9RYmKpc2XLtA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D1F4E18003C for ; Thu, 20 Mar 2025 16:21:55 +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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,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 mail-40136.protonmail.ch (mail-40136.protonmail.ch [185.70.40.136]) (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, 20 Mar 2025 16:21:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gpb.moe; s=protonmail3; t=1742487864; x=1742747064; bh=g/H0CGub31f+jUAnBni7p102lQaQPfPdJUMumpX2L2M=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=nnI+Jcwvr4PLNnQCzr0xzOkUHozAmU+0wrGafRemr6TT36bOZ/ErZnjiKkj/GiHzy FBD/qbQIpAXUjUMRTCZFcKidlPJG3qBvuMCTTj9iDe29SjJqED+ImtAqkIIbQdJeJh YIR/2xaMN3WX1SZwR6juVzo1lva8VLCJEvop7R4IEpVInY4Y6+JIQzsVz7+FF7Y9U/ EJ2uSvL2+bqfvNnPKv577ZtyEnnq/MudqlkFgKul58Cyo4KBzS/EubdGQ67ly4yabg Vd0a68LlxruGKqBV0peaxAplahhKsOzpKkrocuyLU32eK8fJxePT43pNhwzakxXQ8H qhgTv6uiOXo+g== Date: Thu, 20 Mar 2025 16:24:19 +0000 To: Larry Garfield Cc: php internals Subject: Re: [PHP-DEV] [RFC] [Discussion] Never parameters Message-ID: In-Reply-To: <3e35cd25-c851-4ecc-8a1b-102dadb226e5@app.fastmail.com> References: <3e35cd25-c851-4ecc-8a1b-102dadb226e5@app.fastmail.com> Feedback-ID: 96993444:user:proton X-Pm-Message-ID: 2fa77c0cf7491183b4cd04b17b2b97cdd3734b0d 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: internals@gpb.moe ("Gina P. Banyard") On Tuesday, 11 March 2025 at 21:45, Larry Garfield = wrote: > On Mon, Mar 10, 2025, at 2:05 PM, Daniel Scherzer wrote: >=20 > > Hi internals, > >=20 > > I'd like to start discussion on a new RFC about allowing `never` for > > parameter types when declaring a method. > >=20 > > * RFC: https://wiki.php.net/rfc/never-parameters-v2 > > * Implementation: https://github.com/php/php-src/pull/18016 > >=20 > > -Daniel >=20 >=20 > I have a use case for this in Serde, so would be in favor. >=20 > We should not block this kind of improvement on the hope of generics. Wor= st case, we have this plus generics so you have options, how terrible. >=20 > Rust-style associated types would probably work as well. I'd be fine with= that approach, too. One could argue they're more valuable as a sort of "ju= nior generics," but absent anyone able and willing to implement them, again= , worst-case we end up with options in the future. >=20 > --Larry Garfield As the person that had the initial discussion in R11 with Jordan [1] never = as a parameter type for an interface actually is not the solution for "poor= man generics". Matthew Fonda [2] already replied to the thread pointing out the remark Nik= ita made in the discussion of the previous RFC. But importantly, going from mixed parameter type to a generic parameter typ= e is *allowed* and not a BC change, however, going from a never parameter type to a generic parameter type is a= BC break. Thus, I am not sure this really a good idea. The argument from Alwin is more compelling but considering we don't have co= nditional types, not sure if this makes sense either. Best regards, Gina P. Banyard [1] https://chat.stackoverflow.com/transcript/11?m=3D52810456#52810456 [2] https://externals.io/message/126698#126791