protected static function array_map_assoc( callable $callback, array $array ) {
		$new = [];

		foreach ( $array as $k => $v ) {
			$u = $callback( $k, $v );

			if ( ! empty( $u ) ) {
				$new[ \key( $u ) ] = \current( $u );
			}
		}

		return $new;
	}
protected static function array_map_assoc( callable $callback, array $array ) {
		$new = [];

		foreach ( $array as $k => $v ) {
			$u = $callback( $k, $v );

			if ( ! empty( $u ) ) {
				$new[ \key( $u ) ] = \current( $u );
			}
		}

		return $new;
	}
protected static function array_map_assoc ( callable $ callback , array $ array ) { $ new = [ ] ; foreach ( $ array as $ k => $ v ) { $ u = $ callback ( $ k , $ v ) ; if ( ! empty ( $ u ) ) { $ new [ \ key ( $ u ) ] = \ current ( $ u ) ; } } return $ new ; }
Provides an array_map implementation with control over resulting array's keys.

Based on https://gist.github.com/jasand-pereza/84ecec7907f003564584.

@since 6.0.0

@param  callable $callback A callback function that needs to return [ $key => $value ] pairs.
@param  array    $array    The array.

@return array
Provides an array_map implementation with control over resulting array s keys .