Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126967 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 311831A00C1 for ; Fri, 28 Mar 2025 11:18:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1743160583; bh=OVyGPGEJmmVwHZIYQwYqD2qrmeQEv8qy/bTqUrKFZQ0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=mGoSZ0CK6BkTQwT3zUbVSfXPF3i2nXVsPKvLSylgooKSLVY/eRNi0lQf/QHLBTB6k PLy3HMLPq6OuxRUV4ZGXHMGdySxClOvclvsZ8MSmbkKivnxh3Xs2PIuy//9lN7Ibib yx49aiyWj6A29B0Ojs12pTbwZZ/baLRIVIdXxXOvcmtJPb15f38xa6glNcLb2RneLY avdOocbMLRqdiy9ZpdJDIDpTlUIT5gFiV/SyfDKTW3NREZZejs8W8x8dgocLv3l+Nx Mf87Ityj3W2fFe+hYnUU5ddnOAffZAl88NdoJVPEzr+Swy76mZvK87nVymxLZ+IMYS YdZ1vChXSeLnA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B87B4180037 for ; Fri, 28 Mar 2025 11:16:21 +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,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (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, 28 Mar 2025 11:16:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1743160726; bh=POdG0rjWZbgCS8cINMqy0gVE8YjkWNatNd/X+sggaQE=; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:Content-Type:from:to:cc:subject:message-id; b=gFsh5me5gMfy9nwHQX9WhuVnl4oamg/9MRey1hJM15Wp5PFuLwJRASCzK1XUg6lnY yZ2jKwgQMLt1QBdCKdh4zpf9NZTNrQ5z+6VQ0Chk+ZUt2oce529Md71Cm666QUITzO z+0/G6PSMATH49EgYQS8GTNb7v1T3Q9IBS/DVNqTaK7oWJlknoAX1iyJkmcGQdw9hw 32QAbRTI0ignrZBBExZvJCrhJaoWf9KRM32H6eCDSq4e7x38+M8b3+VpL5N9bztTj9 BOGqCp2jUsB34WOMEqRPFq8AFqCoCEgs21nZHo53l+XXk4/lBPcibGt9uxEagL83aG ZmA96ZIwzweQw== Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Fri, 28 Mar 2025 12:18:45 +0100 To: "Gina P. Banyard" Cc: Larry Garfield , php internals Subject: Re: [PHP-DEV] [RFC] [Discussion] Never parameters In-Reply-To: References: <3e35cd25-c851-4ecc-8a1b-102dadb226e5@app.fastmail.com> Message-ID: <2577b6b7fec5e9405d61e023d7ce9d36@bastelstu.be> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) Hi Am 2025-03-21 21:41, schrieb Gina P. Banyard: >> Am I following that? Because just from writing that I am not sure I >> agree, which means I may be misunderstanding. :-) > > I am saying: > interface I { > pubic function foo(never $a); > } > > can ***not*** be "upgraded" to > > interface I { > pubic function foo(A $a); > } > > whereas it is possible to go from > > interface I { > pubic function foo(mixed $a); > } > > to > > interface I { > pubic function foo(A $a); > } > > The implementing classes are completely irrelevant in this context. > I don't follow here. Neither interface “could be upgraded” to make use of generics, since the user would need to specify the type for `A`. However the former could just be upgraded to `I` and the implementing class could still override the parameter type with some specific type. This would not be better than the old interface with the hardcoded `never` type, but also not worse. The latter would need to be upgraded to `I`, since otherwise you would be restricting passing types that you formerly didn't, which makes the entire exercise useless. Best regards Tim Düsterhus