src/Collection/ArrayCollection.php
public function min(?callable $callback = null)
    {
        return $this->reduce(function ($result, $value, $key) use ($callback) {
            if ($callback !== null) {
                $value = $callback($value, $key);
            }

            return ($result === null) || $value < $result ? $value : $result;
        });
    }
public function min(?callable $callback = null)
    {
        return $this->reduce(function ($result, $value, $key) use ($callback) {
            if ($callback !== null) {
                $value = $callback($value, $key);
            }

            return ($result === null) || $value < $result ? $value : $result;
        });
    }
public function min ( ? callable $ callback = null ) { return $ this -> reduce ( function ( $ result , $ value , $ key ) use ( $ callback ) { if ( $ callback !== null ) { $ value = $ callback ( $ value , $ key ) ; } return ( $ result === null ) || $ value < $ result ? $ value : $ result ; } ) ; }
Retrieves the minimum value for a collection

The callback should return a value to compare.

Callback signature:

<code>
function ($value, $key): mixed {}
</code>

@param callable|null $callback The callback function

@return mixed
Retrieves the minimum value for a collection