function array_fuse($list)Arcanist Technical Documentation ()
function array_fuse($list)
Arcanist Technical Documentation ()
Simplifies a common use of array_combine(). Specifically, this:
COUNTEREXAMPLE: if ($list) { $result = array_combine($list, $list); } else { // Prior to PHP 5.4, array_combine() failed if given empty arrays. $result = array(); }
...is equivalent to this:
$result = array_fuse($list);
Parameters
list | $list | List of scalars. |
Return
dict | Dictionary with inputs mapped to themselves. |
- Defined
- src/utils/utils.php:957