Req #80421 [NEW]: Splat operator could support associative arrays

From: Date: Thu, 26 Nov 2020 01:56:40 +0000
Subject: Req #80421 [NEW]: Splat operator could support associative arrays
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-230621@lists.php.net to get a copy of this message
From: david at grudl dot com Operating system: PHP version: 8.0.0RC5 Package: Scripting Engine problem Bug Type: Feature/Change Request Bug description:Splat operator could support associative arrays 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 bug report at https://bugs.php.net/bug.php?id=80421&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=80421&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=80421&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=80421&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=80421&r=needscript Try newer version: https://bugs.php.net/fix.php?id=80421&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=80421&r=support Expected behavior: https://bugs.php.net/fix.php?id=80421&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=80421&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=80421&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=80421&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=80421&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=80421&r=dst IIS Stability: https://bugs.php.net/fix.php?id=80421&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=80421&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=80421&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=80421&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=80421&r=mysqlcfg

« previous php.bugs (#230621) next »