public function max($collection=null, $iterator=null) {
    list($collection, $iterator) = self::_wrapArgs(func_get_args(), 2);
    
    if(is_null($iterator)) return self::_wrap(max($collection));
    
    $results = array();
    foreach($collection as $k=>$item) {
      $results[$k] = $iterator($item);
    }
    arsort($results);
    $__ = new self;
    $first_key = $__->first(array_keys($results));
    return $collection[$first_key];
  }
public function max($collection=null, $iterator=null) {
    list($collection, $iterator) = self::_wrapArgs(func_get_args(), 2);
    
    if(is_null($iterator)) return self::_wrap(max($collection));
    
    $results = array();
    foreach($collection as $k=>$item) {
      $results[$k] = $iterator($item);
    }
    arsort($results);
    $__ = new self;
    $first_key = $__->first(array_keys($results));
    return $collection[$first_key];
  }
public function max ( $ collection = null , $ iterator = null ) { list ( $ collection , $ iterator ) = self :: _wrapArgs ( func_get_args ( ) , 2 ) ; if ( is_null ( $ iterator ) ) return self :: _wrap ( max ( $ collection ) ) ; $ results = array ( ) ; foreach ( $ collection as $ k => $ item ) { $ results [ $ k ] = $ iterator ( $ item ) ; } arsort ( $ results ) ; $ __ = new self ; $ first_key = $ __ -> first ( array_keys ( $ results ) ) ; return $ collection [ $ first_key ] ; }
Get the max value in the collection
Get the max value in the collection