Re: [RFC] Deprecations for PHP 8.6

From: Date: Mon, 29 Jun 2026 17:51:16 +0000
Subject: Re: [RFC] Deprecations for PHP 8.6
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-131601@lists.php.net to get a copy of this message
> I have updated the RFC to include a deprecation proposal for the > list() construct. > > ref: > https://wiki.php.net/rfc/deprecations_php_8_6#deprecate_the_list_construct > Hi Seifeddine, I understand the reasoning behind freeing up the list keyword and having a canonical way to destructure an array. However, I would argue that the scale of this BC break far outweighs the benefits. A quick GitHub code search shows 7 million[^1] hits for "list(" in PHP files. If we deprecate and eventually drop list() in PHP 9, we can safely assume that a large portion of existing code will fail to compile in PHP 9. Furthermore, the documentation for list() offers no hint that [] is preferred over list(), and I would also argue that there is no reason to prefer one over the other. Code-style guides can dictate a project's or library's conventions, but we should take a more conservative approach if we really have a strong technical reason to prefer one syntax over another. Based on the RFC text, aside from freeing up the list keyword for potential future use, I do not see a sufficiently strong technical reason to deprecate list(). Thank you. [^1]: https://github.com/search?q=%22list%28%22+language%3APHP+&type=code

« previous php.internals (#131601) next »