update page now

Voting

: six minus zero?
(Example: nine)

The Note You're Voting On

harry at upmind dot com
7 years ago
/**
     * Gets sequential array of all previously-chained errors
     * 
     * @param Throwable $error
     * 
     * @return Throwable[]
     */
    function getChain(Throwable $error) : array
    {
        $chain = [];

        do {
            $chain[] = $error;
        } while ($error = $error->getPrevious());

        return $chain;
    }

<< Back to user notes page

To Top