title: php array_map callback parameter scope
body: <p>In the following code the callback function passed to wrap_map can't see the argument in the outer function, why? (see code comment for detail)</p>
  
  <pre><code>public static function wrap_implode($ar, $wrap, $delim){
    echo "wrap is $wrap"; //wrap is ok
    $res = array_map(function($val){
       echo "wrap is $wrap"; //wrap is not set here!
       return $wrap. $val . $wrap;
     }, $ar);
  
     return implode($delim, $res);
  }
  </code></pre>