Doc #80538 [NEW]: SUGGESTION: Add reference to array destructuring of return values
| From: | toolmakersteve2 at shawstudio dot com | Date: | Mon, 21 Dec 2020 23:15:29 +0000 |
| Subject: | Doc #80538 [NEW]: SUGGESTION: Add reference to array destructuring of return values | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-18300@lists.php.net to get a copy of this message | ||
From: toolmakersteve2 at shawstudio dot com
Operating system:
PHP version: Irrelevant
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:SUGGESTION: Add reference to array destructuring of return values
Description:
------------
---
From manual page: https://php.net/functions.returning-values
---
Would be good if this section mentioned use of [array destructuring
syntax](https://www.php.net/manual/en/migration71.new-features.php#migration71.new-features.symmetric-array-destructuring)
to access elements of a returned array, as a mechanism to simulate
"multiple returned values".
[$a, $b, $c] = myfunc();
where:
function myfunc() {
return ["first", "second", "third"];
}
--
Edit bug report at https://bugs.php.net/bug.php?id=80538&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80538&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80538&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80538&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80538&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80538&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80538&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80538&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80538&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80538&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80538&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80538&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80538&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80538&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80538&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80538&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80538&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80538&r=mysqlcfg