Req #80844 [NEW]: Array destructuring for mysqli_result
| From: | olafvdspek at gmail dot com | Date: | Sun, 07 Mar 2021 17:50:27 +0000 |
| Subject: | Req #80844 [NEW]: Array destructuring for mysqli_result | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-232610@lists.php.net to get a copy of this message | ||
From: olafvdspek at gmail dot com
Operating system: *
PHP version: Irrelevant
Package: MySQLi related
Bug Type: Feature/Change Request
Bug description:Array destructuring for mysqli_result
Description:
------------
PDO supports this, it'd be nice if mysqli itself supported this as well.
Test script:
---------------
$mysqli = new mysqli('', 'pdo', '123', 'pdo');
foreach ($mysqli->query("select uid, name from users") as [$uid, $name])
// 3
print("$uid: $name\n");
Actual result:
--------------
// PHP Warning: Undefined array key 0 on line 3
// PHP Warning: Undefined array key 1 on line 3
--
Edit bug report at https://bugs.php.net/bug.php?id=80844&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80844&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80844&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80844&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80844&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80844&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80844&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80844&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80844&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80844&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80844&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80844&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80844&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80844&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80844&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80844&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80844&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80844&r=mysqlcfg