Changeset View
Changeset View
Standalone View
Standalone View
src/utils/utils.php
Show First 20 Lines • Show All 948 Lines • ▼ Show 20 Lines | |||||
* | * | ||||
* ...is equivalent to this: | * ...is equivalent to this: | ||||
* | * | ||||
* $result = array_fuse($list); | * $result = array_fuse($list); | ||||
* | * | ||||
* @param list List of scalars. | * @param list List of scalars. | ||||
* @return dict Dictionary with inputs mapped to themselves. | * @return dict Dictionary with inputs mapped to themselves. | ||||
*/ | */ | ||||
function array_fuse(array $list) { | function array_fuse(array $list = null) { | ||||
if ($list) { | if ($list) { | ||||
return array_combine($list, $list); | return array_combine($list, $list); | ||||
} | } | ||||
return array(); | return array(); | ||||
} | } | ||||
/** | /** | ||||
▲ Show 20 Lines • Show All 1,259 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0