Voting

: min(two, five)?
(Example: nine)

The Note You're Voting On

harry at upmind dot com
6 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