Re: [RFC] Deprecations for PHP 8.6

From: Date: Thu, 02 Jul 2026 04:55:04 +0000
Subject: Re: [RFC] Deprecations for PHP 8.6
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-131699@lists.php.net to get a copy of this message
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.

« previous php.internals (#131699) next »