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