Req #80421 [Sus->Opn]: Splat operator could support associative arrays

From: Date: Thu, 26 Nov 2020 02:09:16 +0000
Subject: Req #80421 [Sus->Opn]: Splat operator could support associative arrays
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-230623@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80421&edit=1 ID: 80421 Updated by: requinix@php.net Reported by: david at grudl dot com Summary: Splat operator could support associative arrays -Status: Suspended +Status: Open Type: Feature/Change Request Package: Arrays related PHP Version: 8.1 Block user comment: N Private report: N New Comment: Actually, going to leave this Open since the RFC is six years old. Previous Comments: ------------------------------------------------------------------------ [2020-11-26 02:07:48] requinix@php.net Proposed but not in active discussion. https://wiki.php.net/rfc/additional-splat-usage 8.0 is about to release so the earliest this could happen is 8.1. ------------------------------------------------------------------------ [2020-11-26 01:56:40] david at grudl dot com Description: ------------ Now is possible to use splat operator with associative array when calling functions: func(...['a' => 1, 'b' => 2]) It would be nice if it worked the same way in arrays: $a = [ ...['a' => 1, 'b' => 2] ]; Now it triggers fatal error: Cannot unpack array with string keys ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=80421&edit=1

« previous php.bugs (#230623) next »