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

On Wed, 1 Jul 2026 at 18:31, Tim Düsterhus <tim@bastelstu.be> wrote:

Hi

Am 2026-06-29 20:37, schrieb Seifeddine Gmati:
> I'm actually in favor of deprecating `array()` too, and I raised this
> on the #php-internals Discord channel. The motivation there is weaker
> though: unlike `list`, deprecating `array()` does not free up a
> keyword, since `array` remains a type. The grammar simplification and
> having fewer things for newcomers to learn still apply, and IMO are
> good reasons on their own. If there's appetite for it, I'm happy to
> add it to the RFC.

Hi Tim,

FWIW: I still have a rough draft to make `array()` (or rather: all
non-object types) proper functions that effectively would “stand in” as
cast operators. For `array()` specifically this would allow a
named-argument style of defining arrays with “unquoted keys”:
`array(foo: 1, bar: 2)`.

This would require deprecating `array()` first anyway, no? Otherwise,
dealing with it during parsing would be hacky (looking ahead at
`array(foo` for `:` or `=>` or `,` or `)` to decide if it's an array
or a function call, possible, but hacky think ).

Hi all, 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

···

On 1-7-2026 21:18, Seifeddine Gmati wrote:

On Wed, 1 Jul 2026 at 19:36, Michael Morris [<tendoaki@gmail.com>](mailto:tendoaki@gmail.com) wrote:

On Mon, Jun 29, 2026 at 2:38 PM Seifeddine Gmati [<azjezz@carthage.software>](mailto:azjezz@carthage.software) wrote:

On Mon, 29 Jun 2026 at 18:52, Rowan Tommins [IMSoP]
[<imsop.php@rwec.co.uk>](mailto:imsop.php@rwec.co.uk) 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](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.

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 :)

On Wed, Jul 1, 2026 at 4:52 PM Juliette Reinders Folmer <php-internals_nospam@adviesenzo.nl> wrote:

On 1-7-2026 21:18, Seifeddine Gmati wrote:

On Wed, 1 Jul 2026 at 19:36, Michael Morris [<tendoaki@gmail.com>](mailto:tendoaki@gmail.com) wrote:

On Mon, Jun 29, 2026 at 2:38 PM Seifeddine Gmati [<azjezz@carthage.software>](mailto:azjezz@carthage.software) wrote:

On Mon, 29 Jun 2026 at 18:52, Rowan Tommins [IMSoP]
[<imsop.php@rwec.co.uk>](mailto:imsop.php@rwec.co.uk) 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](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

I didn’t delve into the reasons WordPress is that way because I don’t know them. I assumed they had them - no project that size that has ran that long does anything without much deliberation.

It’s not just the core team that has to change, it’s all the plugins. Most sites have considerable custom theme code - the one I’m responsible for does. I don’t use array() but there are corners I haven’t touched yet that might because I inherited it. I could run that query, but I wouldn’t be comfortable doing it because there are no tests for that old code. I do have tests, but most all of them step over the PHP backend and focus on the output of the twig templates because that’s easier to test in the first place. I do have a sanity test that iterates over 150 pages of the site looking for PHP and JavaScript errors in the output or console, but that’s a bare minimum.

A lot of WordPress sites are ran by small outfits with no coder on staff at all and they delegate the server operation to a provider. Those providers often have hundreds, some thousands of sites. They don’t have the staff to update every bloody one of them.

This can be done. I strongly, strongly advise caution on it. Honestly, this is what I mean by saying perhaps it’s time to have a strict mode language that is code first instead of template first among other features that would be nice to do but have severe BC implications.

Sorry to butt in, but a) the minimum PHP for WP is PHP 7.4

I got the 8.3 number from their official website:
Requirements – WordPress.org , even if the requirement is
7.1, the `[]` syntax works fine there. So, this is not a problem.

* 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.

`list(` does not mean a "list", PHP has no such type right now. It
means you are destructuring an array, `list("foo" => $bar)` is valid.
so "quicker to determine" is false, you can swap every `list(` usage
with `array(` and the behavior will be exactly the same.

* 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).

Yes, it would also yield `$typed->array(`, `$posts->list(`, and more.
If you are looking for a specific syntax, you should use AST based
search tools, not grep text. In which case, you can easily grep for
array construction using `[]` over writes/reads using array-access
syntax. This has never been a problem in every other language that
uses `[]` syntax.

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.

Again, i don't think the language should be held down because of a
single project when the migration path is available, and works for all
supported versions of that project, whether it's WordPress or any
other.

Cheers,
Seifeddine.

It's not just the core team that has to change, it's all the plugins. Most sites have considerable custom theme code - the one I'm responsible for does.

Plugins can also upgrade just as easily, because the alternative
already works for all supported PHP versions.

I could run that query, but I wouldn't be comfortable doing it because there are no tests for that old code. I do have tests, but most all of them step over the PHP backend and focus on the output of the twig templates because that's easier to test in the first place. I do have a sanity test that iterates over 150 pages of the site looking for PHP and JavaScript errors in the output or console, but that's a bare minimum.

This part I can reassure you on directly: you don't need tests to make
this specific change safely. `array($a, $b)`, `list($a, $b)`, and
`[$a, $b]` compile to byte-identical opcodes. it's a guaranteed
language equivalence, not a behavioural one that could differ at
runtime, see Online PHP editor | vld for rlQa6

So a mechanical `array()` -> `[]` rewrite can't change what your code
does, tests or no tests. That's a very different risk profile from a
normal untested refactor.

A lot of WordPress sites are ran by small outfits with no coder on staff at all and they delegate the server operation to a provider.

I don't think this is a language-design concern. A deprecation doesn't
break anything on upgrade day; it emits a notice, and removal is a
full major version away. An unmaintained site isn't chasing new PHP
majors in the first place, so the scenario where it lands on a version
that has *removed* `list()`/`array()` without anyone touching the code
essentially doesn't arise on its own. And where it does arise, it's
because a managed provider moved the PHP version under software that
doesn't support it. Verifying that the code runs on the target version
is the provider's responsibility. That's true for every deprecation
and removal PHP has ever shipped, and it isn't a reason to hold the
language's grammar fixed.

On Wed, Jul 1, 2026 at 5:53 PM Seifeddine Gmati azjezz@carthage.software wrote:

It’s not just the core team that has to change, it’s all the plugins. Most sites have considerable custom theme code - the one I’m responsible for does.

Plugins can also upgrade just as easily, because the alternative
already works for all supported PHP versions.

I could run that query, but I wouldn’t be comfortable doing it because there are no tests for that old code. I do have tests, but most all of them step over the PHP backend and focus on the output of the twig templates because that’s easier to test in the first place. I do have a sanity test that iterates over 150 pages of the site looking for PHP and JavaScript errors in the output or console, but that’s a bare minimum.

This part I can reassure you on directly: you don’t need tests to make
this specific change safely.

I’m stopping right there. I’ve watched people make proclamations like that, execute the code, crash servers costing thousands of dollars in downtime and promptly get fired.

You’ve never been in a position of authority to make a pragmatic decision. No one with that burden would type what you’ve typed. Pragmatic decisions often suck, but they are made for sound reasons. Step out of your ivory tower sometime and maybe you’ll learn that.

I’ve stated my reasoning. I don’t need to repeat it to deaf ears.

I'm stopping right there. I've watched people make proclamations like that, execute the code, crash servers costing thousands of dollars in downtime and promptly get fired.

It isn't a proclamation, it's checkable, and I linked the check.
`list($a, $b)`, `array($a, $b)`, and `[$a, $b]` compile to identical
opcodes: Online PHP editor | vld for rlQa6

The people who crashed servers weren't undone by verifiable
equivalences like this one; they ran transformations they hadn't
verified. This is the opposite: two forms the compiler cannot
distinguish. If you think that's wrong, open the link and show me
where the opcodes differ.

And if the objection is specifically `ast-grep`, fair enough, it's a
general-purpose tool. But the migration doesn't depend on it. Mago
linter already implements exactly this rewrite, on a PHP-specific
parser, you can read the whole thing, it's about thirty lines:

Mago is a full linter with over a hundred rules. If you'd rather have
something with zero config and zero surface area, I'll build you a
single-purpose binary that does only this one transformation. It's at
most 30 minutes of work. The point is that the rewrite is so
mechanically simple that the tooling is almost incidental.

You've never been in a position of authority to make a pragmatic decision. No one with that burden would type what you've typed.

You don't know what I do, so I'll set the personal framing aside and
give you the relevant part: I build static analyzers, linters,
compilers, and rewrite tooling for a living.

I've written a compiler that migrated a multi-million-line codebase
from one language to another, automatically, overnight. Swapping one
AST node for another that is *literally equivalent to the compiler* is
not a feat of engineering courage. That's the basis for what I said.
Technical claims aren't settled by operational burden.

I've stated my reasoning. I don't need to repeat it to deaf ears.

Sure. I disagreed on the merits and said why.

Cheers,
Seifeddine

Sorry to butt in, but a) the minimum PHP for WP is PHP 7.4

I got the 8.3 number from their official website:
[https://wordpress.org/about/requirements/](https://wordpress.org/about/requirements/) , even if the requirement is
7.1, the `[]` syntax works fine there. So, this is not a problem.

Please look again on the same page. The recommended version may be PHP 8.3, the minimum version (“Running on legacy versions?”) is PHP 7.4 and only since recently.

* 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.

`list(` does not mean a "list", PHP has no such type right now. It
means you are destructuring an array, `list("foo" => $bar)` is valid.
so "quicker to determine" is false, you can swap every `list(` usage
with `array(` and the behavior will be exactly the same.

That’s just plain untrue. The one is used for creating an array, the other for destructuring an array.

Swapping list( usages with array( will in most cases result in a parse error. Example: https://3v4l.org/O7O4q#veol

* 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).

Yes, it would also yield `$typed->array(`, `$posts->list(`, and more.
If you are looking for a specific syntax, you should use AST based
search tools, not grep text. In which case, you can easily grep for
array construction using `[]` over writes/reads using array-access
syntax. This has never been a problem in every other language that
uses `[]` syntax.

Agreed, but that doesn’t take anything away from the fact that WP uses it as an argument against switching to the short syntax.

Smile,
Juliette

Please look again on the same page. The _recommended_ version may be PHP 8.3, the minimum version ("Running on legacy versions?") is PHP 7.4 and only since recently.

8.3 is listed as the version up top, and 7.4 appears under "Running on
legacy versions?", which the page itself flags as EOL and recommends
upgrading away from. I'm not sure an End-Of-Life floor is the number
we should be designing around, but it doesn't matter either way: `[]`
destructuring has worked since PHP 7.1, so it's supported on every
version WP runs on, 7.4 and 8.3 alike. The short syntax isn't
version-gated for them under any reading of that page.

That's just plain untrue. The one is used for creating an array, the other for destructuring an array.

You're correct, and I mistyped there. But that's a rewrite detail, not
the point I was making. 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.

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.

And more importantly: even if it is their position, a single project's
style preference shouldn't steer language design. Coding styles adapt
to what the language offers *at the version they target*; that's the
normal direction of the relationship. A project choosing to keep
`array()`/`list()` in their own codebase is entirely their call, and
deprecating the long forms doesn't force them to restyle historical
code on any particular timeline. But "we'd rather keep writing it the
old way" isn't a reason for the language to carry a redundant
construct indefinitely.

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…

On Thu, 2 Jul 2026 at 01:11, Juliette Reinders Folmer
<php-internals_nospam@adviesenzo.nl> wrote:

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.

Fair enough, and I'll happily take your word on the WP side. So I
withdraw the "cautious about treating it as WP's position" point.

It doesn't change my conclusion, though. That a group of core
committers has repeatedly blocked short-array syntax for their own
codebase is entirely their prerogative, but it's a project style
decision, not an argument about the language. WordPress doesn't set
PHP's direction, and "one large project prefers the older form" can't
be the reason PHP keeps a redundant construct indefinitely. Styles
adapt to the language at the version they target; that's the normal
direction of the relationship.

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.

I disagree. As far as I'm aware, no other language uses `list` as the
*destructuring construct*; please point me to one if you know it, I'd
be genuinely interested. The languages I know all use a bracket/paren
form with no keyword: JS `[a, b] = arr`, Python `a, b = seq`, Rust
`let [a, b] = arr`, Swift `let (a, b) = t`. Others, such as SML,
OCaml, and Haskell, have a "List" module or type, but again, that's a
different thing.

Perl is the closest relative and I suspect PHP's inspiration, but Perl
writes it as bare parentheses, `($a, $b) = @arr`, and calls the
operation "list assignment," where "list" means the parenthesised list
of values. There's no `list(...)` keyword doing the unpacking.

And that actually cuts the other way: Perl can call it "list
assignment" because Perl has a genuine first-class list. PHP doesn't
have a list type at all, so the keyword names something that doesn't
exist in the language. It destructures an array and even accepts keys
(`list("k" => $v) = $a`), which a genuine "list" would not.

Cheers,
Seifeddine

On Wed, Jul 1, 2026 at 6:23 PM Seifeddine Gmati azjezz@carthage.software wrote:

I’m stopping right there. I’ve watched people make proclamations like that, execute the code, crash servers costing thousands of dollars in downtime and promptly get fired.

It isn’t a proclamation, it’s checkable, and I linked the check.
list($a, $b), array($a, $b), and [$a, $b] compile to identical
opcodes: https://3v4l.org/rlQa6/vld#v

The people who crashed servers weren’t undone by verifiable
equivalences like this one; they ran transformations they hadn’t
verified. This is the opposite: two forms the compiler cannot
distinguish. If you think that’s wrong, open the link and show me
where the opcodes differ.

And if the objection is specifically ast-grep, fair enough, it’s a
general-purpose tool. But the migration doesn’t depend on it. Mago
linter already implements exactly this rewrite, on a PHP-specific
parser, you can read the whole thing, it’s about thirty lines:
https://github.com/carthage-software/mago/blob/072933fda228a4c52d3858fd4b1797624aa31ac9/crates/linter/src/rule/consistency/array_style.rs#L101-L133

Mago is a full linter with over a hundred rules. If you’d rather have
something with zero config and zero surface area, I’ll build you a
single-purpose binary that does only this one transformation. It’s at
most 30 minutes of work. The point is that the rewrite is so
mechanically simple that the tooling is almost incidental.

You’ve never been in a position of authority to make a pragmatic decision. No one with that burden would type what you’ve typed.

You don’t know what I do, so I’ll set the personal framing aside and
give you the relevant part: I build static analyzers, linters,
compilers, and rewrite tooling for a living.

So my ivory tower remark is on point.

Most of the users of WordPress, myself included, do not have that level of skill. And while I’m doing better than most of my peers I’m still much closer to them than you and understand where they’re coming from. They are, as a rule, adverse to change and prefer to use what they know works. And then there’s the end users who can’t code and install piles and piles of plugins to get their sites to work. Many of those plugins are abandon-ware and haven’t seen updates in years. If they suddenly stop working there’s going to be a lot of people confused and upset, and for what? The code reads prettier to you.

More likely than not you are right about the ease of changing this over using a grep. That’s not the problem. The problem is the disdain and indifference you’ve shown to people who’s skills aren’t up to par with yours. Being a better coder doesn’t make you a better person.

So my ivory tower remark is on point.

I find this hard to answer, because one message ago the objection was
that I'd never been in a position to make a pragmatic decision, and
now it's that I have too much expertise to relate to ordinary users.
Both can't be the problem. I only mentioned what I do because you'd
told me, flatly, that I hadn't done it.

The problem is the disdain and indifference you've shown to people who's skills aren't up to par with yours.

I don't hold that, and nothing I argued requires it. Wanting fewer
people caught out by a change is a fair instinct to have, I don't
think you're wrong to care about it. My point was narrower and not
about anyone's skill: the existence of unmaintained software shouldn't
permanently freeze the language. That's a claim about deprecation
policy, not about the people running those sites.

And it matters that a deprecation breaks nothing on upgrade day. It
emits a notice; removal is a full major version away, years out. A
site nobody maintains also isn't chasing new PHP majors, the two go
together. For an abandoned plugin to suddenly stop working, someone
must actively move it to a major version that removed the feature.
Does WordPress even allow upgrading to a PHP version its plugins don't
support? I don't know. If a managed host does that somehow, without
checking compatibility, the failure isn't in the language.

for what? The code reads prettier to you.

That isn't the motivation. If that were, I'd let a formatter handle it.

The reasons are a simpler grammar, freeing the `list` keyword for a
possible future `list` type, and removing a redundant construct
newcomers otherwise have to learn for no reason. You can think those
aren't worth the churn; that's a legitimate disagreement. "its
prettier" isn't what's actually being proposed.

And this is what I keep coming back to: why this deprecation in
particular? The same RFC deprecates several other things, and at least
one of them is genuinely harder to migrate than `list()`, which makes
the focus on `list()` odd.

Take the deprecation of `_()` in favour of `gettext()` (which is
reasonable, given `_` is being reserved for another purpose). That
looks like a trivial find-and-replace, but it isn't safe. PHP resolves
an unqualified function call by checking the current namespace first
and only then falling back to global. So inside `namespace App;`, a
bare `_(...)` binds to `App\_` if that function exists, and only
otherwise to the global `_`. Blindly rewriting `_` to `gettext` can
therefore change which function actually runs, if there's an
`App\gettext`, the rewritten call now resolves to it instead of the
global one.

A purely syntactic tool like ast-grep cannot catch that, because it's
a whole-program resolution fact, not a textual one. You'd need a
type-aware linter that indexes the entire codebase to do it safely.

`list()` -> `[]` has none of that. The compiler emits identical
opcodes (see the 3v4l link above). So it's the one case where a
one-line ast-grep rewrite is provably correct. If anything, `list()`
is the *safest* migration in the entire RFC, and the harder ones (the
ones that can actually cause issues) aren't the ones drawing the
objection.

I also doubt the abandoned plugins you're picturing are pristine on
every other deprecation in the RFC and happen to trip only on `list(`.
If "some plugins are unmaintained" blocks this, it blocks all of it,
and PHP should never deprecate anything, and we should freeze the
language as it is now.

Being a better coder doesn't make you a better person.

Where exactly did I give you the impression that I think I'm a better
person? We are having a technical discussion; you are turning it
personal.

Cheers,
Seifeddine

On Wednesday, Jul 01, 2026 at 10:44 PM, Seifeddine Gmati <azjezz@carthage.software> wrote:

And this is what I keep coming back to: why this deprecation in
particular? The same RFC deprecates several other things, and at least
one of them is genuinely harder to migrate than list(), which makes
the focus on list() odd.

Because array construction and destructuring are much more widely used than most anything else in the deprecations RFC, be it with “modern” or “legacy” syntax. And given core functions like var_export still use the long “legacy” syntax for arrays, it seems like that alone should block a deprecation proposal until someone finally lands a solution to let it use the other syntax.

given core functions like var_export still use the long “legacy” syntax for arrays

The proposal is to deprecate `list()`, not `array()`.

On 30.06.26 00:37, Seifeddine Gmati wrote:

Hello Internals,

I have updated the RFC to include a deprecation proposal for the
`list()` construct.

ref: PHP: rfc:deprecations_php_8_6

Cheers,
Seifeddine.

Hey Seifeddine

with you here on the problems with list(); that it should be deprecated and go eventually. Though, you get quite some resistance with strong arguments.

You said in one of your answers something like "one project holding back the PHP language". While in essence true, Wordpress is not just any project -- it's still the biggest multiplicator for PHP usage. The amount of deprecation logs printed on a daily basis, the amount of support generated, and the general impact will be huge.

I know that's not what you signed up for when adding this deprecation to the RFC, but perhaps getting `list()` as language construct deprecated would be easier if there would be an actual function replacement like `array_destruct()` that would address the readability argument (which is hard to discuss away because it is hyper subjective). Generally, there is nothing wrong with having a short and long syntax -- we do have the same with control flows and such.

Of course I don't mean to ask you to withdraw the deprecation proposal here. However, in case it fails the above perhaps could bring this forward (probably together with solutions for `array()` and `var_export()` :)).

--

Cheers
Nick

On 02.07.26 11:51, Seifeddine Gmati wrote:

`array_destruct()` that would address the readability argument (which is
hard to discuss away because it is hyper subjective).

This can't work, and not for stylistic reasons. Destructuring happens
in a *write* context: the construct sits on the left of `=` and
receives bindings. A function can't do that. `array_destruct($a, $b) =
$arr` isn't expressible, functions return values, they don't accept
assignment targets. So a function couldn't replace `list()`; you'd
need a new *construct* to stand in for it, which means adding grammar
rather than removing it. That's the opposite of what the RFC is trying
to do. This is also the crux of the readability point, I think:
`list()` looks like a function precisely because of the parentheses,
but it isn't one, and that mismatch is part of what makes the name
misleading in the first place.

Fair enough. I had no idea it couldn't be done.
Agreed that adding another language construct doesn't make sense; only the naming isn't enough.

You said in one of your answers something like "one project holding back
the PHP language". While in essence true, Wordpress is not just any
project -- it's still the biggest multiplicator for PHP usage. The
amount of deprecation logs printed on a daily basis, the amount of
support generated, and the general impact will be huge.

I'll be honest, the size of the project isn't the part I find
relevant. The objection only works if you assume a chain that doesn't
actually happen: that merging this deprecation means every WP instance
upgrades, that PHP 9.0 appears out of nowhere, and that apps break the
next morning. None of those steps are automatic or imminent.

A deprecation in 8.6 emits a notice; it is not an error and nothing
stops working, regardles of how many `list()` instances are in the
codebase. Actual removal is 9.0, which is years away. And instances
don't upgrade themselves. A site must be actively moved onto a version
that removed the construct before anything can break, and a site
nobody maintains isn't being moved anywhere. So the "huge impact" is,
at worst, deprecation notices in logs during a multi-year window that
exists precisely to absorb them. That's true whether WordPress has one
instance or a hundred million; the count doesn't change what a notice
is.

No project steers the language for me, WordPress included. but I don't
even need that principle here. The scenario people are picturing just
isn't the one the deprecation cycle produces.

`array_destruct()` that would address the readability argument (which is
hard to discuss away because it is hyper subjective).

This can't work, and not for stylistic reasons. Destructuring happens
in a *write* context: the construct sits on the left of `=` and
receives bindings. A function can't do that. `array_destruct($a, $b) =
$arr` isn't expressible, functions return values, they don't accept
assignment targets. So a function couldn't replace `list()`; you'd
need a new *construct* to stand in for it, which means adding grammar
rather than removing it. That's the opposite of what the RFC is trying
to do. This is also the crux of the readability point, I think:
`list()` looks like a function precisely because of the parentheses,
but it isn't one, and that mismatch is part of what makes the name
misleading in the first place.

Hi

Am 2026-07-01 21:25, schrieb Seifeddine Gmati:

FWIW: I still have a rough draft to make `array()` (or rather: all
non-object types) proper functions that effectively would “stand in” as
cast operators. For `array()` specifically this would allow a
named-argument style of defining arrays with “unquoted keys”:
`array(foo: 1, bar: 2)`.

This would require deprecating `array()` first anyway, no? Otherwise,
dealing with it during parsing would be hacky (looking ahead at
`array(foo` for `:` or `=>` or `,` or `)` to decide if it's an array
or a function call, possible, but hacky think ).

It's not particularly pretty, but possible. The `array()` syntax will not actually be a function call, it will just look like one. Basically the `:` syntax can just parse into the same AST as the `=>` syntax, the grammar just needs to make sure that they may not be mixed. The array() function will be made available in addition to support `\array` (i.e. with a fully-qualified name) and `array(...)` (i.e. a first class callable).

My rough draft is in Make `array()` a function by TimWolla · Pull Request #18613 · php/php-src · GitHub, I think there are some issues still with properly compiling the array, because the AST node for `=>` takes the two sides in different order compared to named arguments and I wanted to document the AST structure first (and then got distracted by more important things).

Best regards
Tim Düsterhus

Hi

Am 2026-07-02 05:51, schrieb Seifeddine Gmati:

`array_destruct()` that would address the readability argument (which is
hard to discuss away because it is hyper subjective).

This can't work, and not for stylistic reasons. Destructuring happens
in a *write* context: the construct sits on the left of `=` and
receives bindings. A function can't do that. `array_destruct($a, $b) =
$arr` isn't expressible

That specific syntax would indeed not be possible, but the following would work:

     <?php

     function destruct(array $a, &...$results) {
         foreach ($results as $key => &$val) {
             $val = $a[$key];
         }
     }

     destruct([1, 2, 3, 'b' => 'b'], $a, b: $b);
     var_dump($a, $b);

see: Online PHP editor | output for ia489n

Best regards
Tim Düsterhus