Re: [PHP-DEV] [RFC] Deprecations for PHP 8.6
[email protected] (Seifeddine Gmati)
| Newsgroups | php.internals |
|---|---|
| Message-ID | <CAFyg4HhOZRd-ZZWBYWd5z-qiA4bJG_Un1Qo5M9zboHHfotOaRQ@mail.gmail.com> |
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 Michael, > Are you crazy? Yes. > 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 dislike the idea that the langauge should not progress because people genuinely don't want to take 2 minutes to upgrade their codebase. 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 :) > That would almost certainly cause that community to either refuse to upgrade, leading to the problem the Python community faced with 2 & 3, or cause them to fork PHP. I don't think a single syntax change like `array($x)` to `[$x]` would cause the Python 2 to Python 3 chaos here, given that the "modern" syntax already works in older PHP versions. Cheers, Seifeddine.