title: PHP: Can I get the index in an array_map function?
body: <p>I'm using a map in php like so:</p>
  
  <pre><code>function func($v) {
      return $v * 2;
  }
  
  $values = array(4, 6, 3);
  $mapped = array_map(func, $values);
  var_dump($mapped);
  </code></pre>
  
  <p>Is it possible to get the index of the value in the function?</p>
  
  <p>Also - if I'm writing code that needs the index, should I be using a for loop instead of a map?</p>