title: array_walk vs array_map vs foreach
body: <p>I'm trying to compare these three but it seems only <code>array_map</code> works. </p>
  
  <pre><code>$input = array( '  hello   ','whsdf                                    ','                              lve you','                              ');
  $input2 = array( '  hello   ','whsdf                                    ','                              lve you','                              ');
  $input3 = array( '  hello   ','whsdf                                    ','                              lve you','                              ');
  
  $time_start = microtime(true);
  $input = array_map('trim',$input);
  $time_end = microtime(true);
  $time = $time_end - $time_start;
  
  echo "Did array_map in $time seconds&lt;br&gt;";
  
  foreach($input as $in){
      echo "'$in': ".strlen($in)."&lt;br&gt;";
  }
  
  ////////////////////////////////////////////////
  
  $time_start = microtime(true);
  array_walk($input2,'trim');
  $time_end = microtime(true);
  $time = $time_end - $time_start;
  
  echo "Did array_walk in $time seconds&lt;br&gt;";
  
  foreach($input2 as $in){
      echo "'$in': ".strlen($in)."&lt;br&gt;";
  }
  
  ////////////////////////////////////////////////
  
  
  $time_start = microtime(true);
  foreach($input3 as $in){
      $in = trim($in);
  }
  $time_end = microtime(true);
  $time = $time_end - $time_start;
  
  echo "Did foreach in $time seconds&lt;br&gt;";
  
  foreach($input3 as $in){
      echo "'$in': ".strlen($in)."&lt;br&gt;";
  }
  </code></pre>
  
  <p>What Am I Doing Wrong? Here's the output:</p>
  
  <pre><code>Did array_map in 0.00018000602722168 seconds
  'hello': 5
  'whsdf': 5
  'lve you': 7
  '': 0
  Did array_walk in 0.00014209747314453 seconds
  ' hello ': 10
  'whsdf ': 41
  ' lve you': 37
  ' ': 30
  Did foreach in 0.00012993812561035 seconds
  ' hello ': 10
  'whsdf ': 41
  ' lve you': 37
  ' ': 30
  </code></pre>
  
  <p>It's not trimming for <code>array_walk</code> and the <code>foreach</code> loop.</p>