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

From: Date: Thu, 26 Nov 2020 02:07:48 +0000
Subject: Req #80421 [Opn->Sus]: Splat operator could support associative arrays
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-230622@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: Open +Status: Suspended Type: Feature/Change Request -Package: Scripting Engine problem +Package: Arrays related -PHP Version: 8.0.0RC5 +PHP Version: 8.1 Block user comment: N Private report: N New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [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 (#230622) next »