Change record status: 
Project: 
Introduced in branch: 
8.x
Description: 

drupal_map_assoc() existed to work around a PHP bug with array_combine().
In PHP 5.4 this bug was fixed, which resulted in this function's removal in Drupal 8 as the same behavior can be achieved with array_combine() and array_map().

In earlier versions of Drupal 8 \Drupal\Component\Utitlity\MapArray::copyValuesToKeys() existed for the same purpose. This method (and the containing class) has been removed, as well.

D7

$options = drupal_map_assoc($my_array);
// With callback
$options = drupal_map_assoc($my_array, $callback);

D8

$options = array_combine($my_array, $my_array);
// With callback
$options = array_map($callback, array_combine($my_array, $my_array));

Earlier D8 (no longer valid)

use Drupal\Component\Utility\MapArray;

$options = MapArray::copyValuesToKeys($my_array);
// With callback
$options = MapArray::copyValuesToKeys($my_array, $callback);
Impacts: 
Module developers
Themers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other: 
Other updates done