Re: [PHP-DEV] [RFC] Deprecations for PHP 8.6
[email protected] (Tim Düsterhus)
| Newsgroups | php.internals |
|---|---|
| Message-ID | <[email protected]> |
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. 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)`. Best regards Tim Düsterhus