src/PEAR/ErrorStack.php
function hasErrors($level = false)
    {
        if ($level) {
            return isset($this->_errorsByLevel[$level]);
        }
        return count($this->_errors);
    }
function hasErrors($level = false)
    {
        if ($level) {
            return isset($this->_errorsByLevel[$level]);
        }
        return count($this->_errors);
    }
Determine whether there are any errors on the stack
@param string|array Level name.  Use to determine if any errors
of level (string), or levels (array) have been pushed
@return boolean