// The first element in the stack is the call,
// but we want to check if that call occured in one of
// the assertion functions, which is the next element
// in the stack.
while (($caller =
next($backtrace)) &&
(substr($caller['function'],
0,
6) ==
'assert' ||
$caller['function'] == 'pass' ||
$caller['function'] == 'fail' ||
$caller['function'] == 'error')) {
// We remove that call. array_shift also resets the array.
}