clarify the destructuring list() concept
| From: | Mönôme Epson | Date: | Fri, 05 Jan 2024 20:44:00 +0000 |
| Subject: | clarify the destructuring list() concept | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-122126@lists.php.net to get a copy of this message | ||
Hello internals,
> The purpose of list() is to assign a list of variables.
What should be the underlying concept behind the list() language construct?
I propose that list() is the reciprocal of array().
That is, if array() is a function call, then list() is the signature of a
function.
Do you agree ?
Regards, Alexandre
PS: For historical reason, i propose to allow to syntaxe :
list(name: $name) = ['name'=>$name];// maybe discussed
list('name'=> $name) = ['name'=>$name];