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

[email protected] (Juliette Reinders Folmer)
Newsgroups php.internals
Message-ID <[email protected]>
On 2-7-2026 0:54, Seifeddine Gmati wrote:
> My point was about the *name*. The
> accessibility argument was that the keyword lets you tell "a list or
> an array" apart at a glance, and that's what i disagree on, because
> PHP has no list. `list()` doesn't construct anything; it destructures
> an array. The keyword names a type that doesn't exist, and it accepts
> keys (`list("foo" => $bar) = $arr`), which a genuine "list" wouldn't.
> So "the keyword tells you what it is" is exactly backwards here: the
> keyword tells you something false.

The fact that the `list()` name may be confusing is IMO not a valid 
argument. That keyword has been in use for that particular purpose since 
a very long time in PHP - and even longer in other languages.

>> Agreed, but that doesn't take anything away from the fact that WP uses it as an argument against switching to the short syntax.
> I haven't seen anyone from the WP team make that argument in this
> thread, so I'd be cautious about treating it as WP's settled position
> rather than a reason attributed to them.

Ahum.... I'm one of the maintainers of the WordPress Coding Standards, 
which is the team which would address these type of syntax changes for WP.
There have been numerous discussions [1][2][3] within the WP community 
about allowing/enforcing short array syntax over the years and time and 
time again, this has been blocked by a select group of WP Core 
committers not supporting the proposal for the reasons I outlined before 
(while the overwhelming majority of commenters from the WP community do 
support the proposal).

1: 
https://make.wordpress.org/core/2019/03/26/coding-standards-updates-for-php-5-6/ 

2: https://make.wordpress.org/core/2019/07/12/php-coding-standards-changes/
3: There have also been (more recent) discussions on the WP Slack, in 
Trac and in various GH issues too...
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.