title: array_map and pass 2 arguments to the mapped function - array_map(): Argument #3 should be an array
body: <p>I have an abstract class that looks like this:</p>
  <pre><code>abstract class Transformer {
  
      /**
       * Transform a collection of items
       *
       * @param array $items
       * @param bool $format
       * @return array
       */
      public function transformCollection(array $items, $format)
      {
          return array_map([$this, 'transform'], $items, $format);
      }
  
      /**
       * Transform a item
       *
       * @param array $item
       * @param bool $format
       * @return mixed
       */
      public abstract function transform(array $item, $format);
  
  }
  </code></pre>
  <p>Then I have the following class that implements it:</p>
  <pre><code>class ServiceLogTransformer extends Transformer {
  
      public function transform(array $service_log, $format = false)
      {
          return [
              'id'    =&gt; $service_log['id'],
              'date'  =&gt; $service_log['log_date'],
              'time'  =&gt; $service_log['log_time'],
              'type'  =&gt; ($format ? status_label($service_log['log_type']) : $service_log['log_type']),
              'entry' =&gt; $service_log['log_entry']
          ];
      }
  
  }
  </code></pre>
  <p>When this code runs, I get the error:</p>
  <h2>array_map(): Argument #3 should be an array</h2>
  <p>How do you pass 2 or more arguments when you call <code>array_map</code> function within a class? I checked the PHP Documentation and it looks like this is allowed, but it isn't working on my Larave 4.2 project.</p>
  <p>Any ideas?</p>