Re: [PHP-DEV] [RFC] Deprecations for PHP 8.6

[email protected] ("Rowan Tommins [IMSoP]")
Newsgroups php.internals
Message-ID <[email protected]>
On 29/06/2026 17:37, Seifeddine Gmati wrote:
> Hello Internals,
>
> 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


I don't think it makes sense to deprecate list() if we're not 
deprecating array() - they're exact counterparts, and both replaced by 
the [] syntax. Indeed, [] as a replacement for array() dates to PHP 5.4, 
but as a replacement for list() was only added in PHP 7.1.

I agree that it's not immediately clear that array() constructs and 
list() extracts, but I think your example is unfair, because both 
array($a, $b) and list("a" => $a, "b" => $b) are also valid.

A possible justification would be that one is more common than the 
other, but right now there's no discussion or analysis of that. (Which 
as I've said elsewhere in this thread will be an automatic "No" vote 
from me if it's still the case at voting time.)

-- 
Rowan Tommins
[IMSoP]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.