src/Lazy/Enumerable.php
public function groupBy(callable $func)
    {
        $result = [];
        foreach ($this->each() as $k => $v) {
            $this->_groupBy($result, $k, $v, $func);
        }
        return $result;
    }
public function groupBy(callable $func)
    {
        $result = [];
        foreach ($this->each() as $k => $v) {
            $this->_groupBy($result, $k, $v, $func);
        }
        return $result;
    }
public function groupBy ( callable $ func ) { $ result = [ ] ; foreach ( $ this -> each ( ) as $ k => $ v ) { $ this -> _groupBy ( $ result , $ k , $ v , $ func ) ; } return $ result ; }
Return an array which aggregated by func

@param callable $func
@return array
Return an array which aggregated by func