[PHID-USER-1, PHID-USER-2], * PhabricatorPHIDConstants::PHID_TYPE_PROJ => [PHID-PROJ-3]] * * @param phids array of phids * @return map of phid type => list of phids */ function phid_group_by_type($phids) { $result = array(); foreach ($phids as $phid) { $type = phid_get_type($phid); $result[$type][] = $phid; } return $result; }