public function invoke($collection=null, $function_name=null, $arguments=null) {
    $args = self::_wrapArgs(func_get_args(), 2);
    $__ = new self;
    list($collection, $function_name) = $__->first($args, 2);
    $arguments = $__->rest(func_get_args(), 2);
    
    // If passed an array or string, return an array
    // If passed an object, return an object
    $is_obj = is_object($collection);
    $result = (empty($arguments)) ? array_map($function_name, (array) $collection) : array_map($function_name, (array) $collection, $arguments);
    if($is_obj) $result = (object) $result;
    
    return self::_wrap($result);
  }
public function invoke($collection=null, $function_name=null, $arguments=null) {
    $args = self::_wrapArgs(func_get_args(), 2);
    $__ = new self;
    list($collection, $function_name) = $__->first($args, 2);
    $arguments = $__->rest(func_get_args(), 2);
    
    // If passed an array or string, return an array
    // If passed an object, return an object
    $is_obj = is_object($collection);
    $result = (empty($arguments)) ? array_map($function_name, (array) $collection) : array_map($function_name, (array) $collection, $arguments);
    if($is_obj) $result = (object) $result;
    
    return self::_wrap($result);
  }
public function invoke ( $ collection = null , $ function_name = null , $ arguments = null ) { $ args = self :: _wrapArgs ( func_get_args ( ) , 2 ) ; $ __ = new self ; list ( $ collection , $ function_name ) = $ __ -> first ( $ args , 2 ) ; $ arguments = $ __ -> rest ( func_get_args ( ) , 2 ) ; // If passed an array or string, return an array // If passed an object, return an object $ is_obj = is_object ( $ collection ) ; $ result = ( empty ( $ arguments ) ) ? array_map ( $ function_name , ( array ) $ collection ) : array_map ( $ function_name , ( array ) $ collection , $ arguments ) ; if ( $ is_obj ) $ result = ( object ) $ result ; return self :: _wrap ( $ result ) ; }
Invoke the named function over each item in the collection, optionally passing arguments to the function
Invoke the named function over each item in the collection optionally passing arguments to the function