On 1-7-2026 21:18, Seifeddine Gmati wrote:
On Wed, 1 Jul 2026 at 19:36, Michael Morris <[email protected]> wrote:
On Mon, Jun 29, 2026 at 2:38 PM Seifeddine Gmati <[email protected]> 
wrote:
On Mon, 29 Jun 2026 at 18:52, Rowan Tommins [IMSoP]
<[email protected]> wrote:
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'm actually in favor of deprecating `array()` too, and I raised this
on the #php-internals Discord channel.


Hi all,
That would invalidate at least three quarters of the WordPress core code base 
and almost all of it's plugins, not to mention THOUSANDS of tutorials on stack 
overflow.  And whether you like it or not about 40-60% of PHP sites use 
WordPress, depending on who you ask.
The migration is running a single command: `ast-grep -p
'array($$$ARGS)' -r '[$$$ARGS]' --lang php -U`

I don't think the WordPress team would have trouble replacing
`array()` with `[]` given that the minimum requirement for WordPress
is PHP 8.3. Older WordPress installations don't have to upgrade
because if they didn't bother upgrading WordPress, i doubt they will
bother upgrading PHP :)

Sorry to butt in, but a) the minimum PHP for WP is PHP 7.4 at the moment and b) the arguments for WordPress to stick with the old `array()` and `list()` has nothing to do with them "not bothering to upgrade". They are fully aware of the ease of upgrading and the (PHPCS) tooling to do so is available and has been for the longest time.

Reasons for WordPress to **not** switch to short array/list syntax are far more along the lines of: * Code accessibility - it is much quicker to determine whether something is a list or an array when visually scanning code when the keywords are being used. * Searchability of the code base - searching for `array(` or `list(` will yield useful results, searching for `[` will yield a hundred times more results, most of which are not what one is looking for (array access, assignments etc).

Other than that, they've brought up practical reasons for not switching to the new syntax in the past. Think along the lines of there being thousands of (often long-standing) open patches, which would need to be updated before they can be merged. The extra burden this would put on the limited amount of committers is another reason.

So, please, if you use WP in this discussion to argue either side, please inform yourself before doing so.

Personally, I believe both the code accessibility as well as the searchability arguments do have some value, so it might be a good idea for the discussion to focus more on those.

Smile,
Juliette





Reply via email to