src/Lazy/Enumerable.php
public function unique(callable $func = null)
    {
        return new Enumerator(
            function () use ($func) {
                $exists = [];
                foreach ($this->each() as $k => $v) {
                    $comp = $func ? $func($v) : $v;
                    if (!in_array($comp, $exists, true)) {
                        $exists[] = $comp;
                        yield $k => $v;
                    }
                }
            }
        );
    }
public function unique(callable $func = null)
    {
        return new Enumerator(
            function () use ($func) {
                $exists = [];
                foreach ($this->each() as $k => $v) {
                    $comp = $func ? $func($v) : $v;
                    if (!in_array($comp, $exists, true)) {
                        $exists[] = $comp;
                        yield $k => $v;
                    }
                }
            }
        );
    }
public function unique ( callable $ func = null ) { return new Enumerator ( function ( ) use ( $ func ) { $ exists = [ ] ; foreach ( $ this -> each ( ) as $ k => $ v ) { $ comp = $ func ? $ func ( $ v ) : $ v ; if ( ! in_array ( $ comp , $ exists , true ) ) { $ exists [ ] = $ comp ; yield $ k => $ v ; } } } ) ; }
Return Enumerator which returns unique values

@param callable $func
@return Enumerator
Return Enumerator which returns unique values