Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127918 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 13F3A1A00BC for ; Sun, 6 Jul 2025 13:35:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1751808808; bh=5VCg+htyFTixSr2CqmQporGGYrCmmON8E0Uj1SyCGgw=; h=Date:From:Subject:To:References:In-Reply-To:From; b=aK9IzuuZX+8iJS/yvDs41fY/EhnCln0pArtyfaiHbx4RDRWDdZYM8BDPisJdVWq+P y1Pe/JELo8oImxkUb6/gQrbSdMNQJhXFZpMe0w/FogPSMczjhEVPkHL3bmPKSL73T8 cut9DAR8LrF7COD22XVsWmmXxpZxM5vEuaGz6tscXjnqLMWxgo+FvSEIHCwOtMD7ME rW2e+fgX4A4JvW8gXxgV081E0sv6cjLWWqBNTw1UVZ5vC3Tt4lIJZKHbFTUvRbBU82 I6C1/4GsmgUuPmyBZNcYMlthoz5u4wqC1TJ8iJ6f1MMUvX3Rj3QjNwZgX7cum89FNz ibMCNoP6MRBNQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E3484180054 for ; Sun, 6 Jul 2025 13:33:27 +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=-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.1 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) 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 ; Sun, 6 Jul 2025 13:33:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1751808917; bh=gSyDmsm06mS8wP56ciuKWoC2DbsMjZPeV8gjqiizZsM=; h=Message-ID:Date:MIME-Version:From:Subject:To:References: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=Y09POYtofFjl3+ABTLN3rLfQjIgQ+rEMIiz7AC2/0XGeYQnUhAYMerIr4eGOupCRr ZkTitvL847FMe9attL8cS8dXEzHcl7emCU6WG8lZx91QamNuTroKq25F5RioW5rjuq FXM6YocaxFLgg/tRvFTZeaUnTXQj58WlF+8yWErUcPiv+lWgEqdWf+z768opUgedW5 XgqJAqBZS89P4KuqNITPRgLDmeEJOWM75zxoVbILL5jQBrYakgMtrI0nwRDDQtRiEv sHufFJQfYdNYD/y4Ixt/JhGRS48T0dcFwCDOESiAiIXRij/RLxn8/KvWy1QKOAm0nB 7GFkGfUKeEEgw== Message-ID: Date: Sun, 6 Jul 2025 15:35:16 +0200 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Subject: Re: [PHP-DEV] [RFC] Deprecations for PHP 8.5 To: Niels Dossche , internals@lists.php.net References: Content-Language: en-US In-Reply-To: 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 On 7/4/25 09:01, Niels Dossche wrote: > First of all, that's a huge list of deprecations and I think we should tone down on that. > Especially if a feature still has a purpose and is not harmful or buggy, then we should probably consider not deprecating it. It's a long list, but many of the deprecations are just obvious follow-ups of a previous RFC or closely related. As an example, I would consider all the `_close()` / `_free()` / `destroy()` function deprecations to be a single one in practice and then one that just fixes an inconsistency, since others are already deprecated. Similarly Reflection*::setAccessible() is a follow-up for a previous RFC that deferred the deprecation to reduce the impact on existing code. Defining "harmful" is also complicated. Is making the language harder to learn for newcomers "harmful" (e.g. the case-with-semicolon one, which is just a tiny bit of syntax difference for the same thing)? Is allowing for confusing code (e.g. Reflection::setAccessible(false)) "harmful"? In both cases, I'd say: Yes, that is harmful. > Secondly, I'm tired of having to deal with useless deprecation messages. > A lot of deprecation messages are completely useless for developers because they do not point to a reason or a replacement. > That leaves you needing to look up the documentation, which is also incomplete. > See https://github.com/php/php-src/issues/14320 > Therefore, any deprecation proposed in this RFC that does not explicitly list the deprecation message, I will vote no for. I agree that having useful deprecation messages is important and I've just added a `trigger_error()` example to the PDO 'uri:' deprecation that I proposed. My other proposals already had the `#[\Deprecated]` attribute including the message. > There are a few things I will vote no for: > > * Deprecate semicolon after case in switch statement. > People seem to use this and it doesn't seem harmful to have. Just because you don't like it doesn't mean we should yeet it. See above. Also: The RFC seems to indicate that this is not actually used in practice. > * Deprecate attributes applying to multiple class properties/constants. > On the edge, confusing yes, but it might break real code. Since this is a recurring thing, I feel compelled to point out terminology: A deprecation in itself is not a breaking change. > * Deprecate __debugInfo() returning null > Weird, especially as the docs say the return type is ": array", but not harmful. I consider undocumented behavior to be harmful and in this case deprecating (and removing) the undocumented behavior seems to be better than adding another special case to the language that users need to learn about. > * Deprecate passing spl_autoload_call() to spl_autoload_unregister() > This is very ad hoc, and as Ilija pointed out, we can't prevent workarounds for this. So what's the point really. > The behaviour may be weird, but notice that people won't do this by accident. See above regarding "undocumented behavior". Also to my understanding this is not about "preventing workarounds", but rather removing this branch, which is just surprising behavior: https://github.com/php/php-src/blob/677a1f80c86b7a5848985bf44714210d0b89900b/ext/spl/php_spl.c#L583-L590 Best regards Tim Düsterhus