title: Is there a way to have named indexes on array_map output?
body: <p>I have the code below:</p>
  
  <pre><code>array_map(
      function (ReflectionParameter $parameter){
  
          $paramName = $parameter-&gt;getName();
  
          return $this-&gt;params[$paramName];
      ,
      $this-&gt;getParametersNeededByTheConstructor()
  );
  </code></pre>
  
  <p>It outputs something like:</p>
  
  <blockquote>
    <ol>
    <li>[0] => 'ParamValue'</li>
    <li>[2] => 'ParamValue'</li>
    <li>[3] => 'ParamValue'</li>
    <li>[4] => 'ParamValue'</li>
    <li>[5] => 'ParamValue'</li>
    </ol>
  </blockquote>
  
  <p>Is there a way to set the array indexes in the code above? For example:</p>
  
  <blockquote>
    <ol>
    <li>[paramName0] => 'ParamValue'</li>
    <li>[paramName2] => 'ParamValue'</li>
    <li>[paramName3] => 'ParamValue'</li>
    <li>[paramName4] => 'ParamValue'</li>
    <li>[paramName5] => 'ParamValue'</li>
    </ol>
  </blockquote>