Re: [RFC][DISCUSSION] Allow default value in list() syntax
| From: | Andreas Treichel | Date: | Fri, 11 Aug 2017 17:46:27 +0000 |
| Subject: | Re: [RFC][DISCUSSION] Allow default value in list() syntax | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-100188@lists.php.net to get a copy of this message | ||
You can merge the result with default values like this:
[$foo, $bar, $foobar] = explode(':', 'foo:bar') + [23, 42, 1337];
var_dump($foo, $bar, $foobar);