[Discussion] Make objects unpackable by default
| From: | MrMeshok | Date: | Thu, 14 Nov 2024 10:28:33 +0000 |
| Subject: | [Discussion] Make objects unpackable by default | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-125956@lists.php.net to get a copy of this message | ||
Hello, Internals!
As you know if you try to unpack a regular object (
...$object) you will
get an error: Only arrays and Traversables can be unpacked.
I don't really see a reason for this restriction, because foreach on
objects works perfectly fine, so I made a feature request on GitHub to
change this behavior (https://github.com/php/php-src/issues/16038) and was
advised to see opinions on this here.
So, what do you think? And does this change require RFC?
Best regards,
Ilya