function PEAR::expectError in Calendar Systems 5
This method is used to tell which errors you expect to get. Expected errors are always returned with error mode PEAR_ERROR_RETURN. Expected error codes are stored in a stack, and this method pushes a new element onto it. The list of expected errors are in effect until they are popped off the stack with the popExpect() method.
Note that this method can not be called statically
@access public
Parameters
mixed $code a single error code or an array of error codes to expect:
Return value
int the new depth of the "expected errors" stack
File
- calendar/
lib/ PEAR.php, line 389
Class
- PEAR
- Base class for other PEAR classes. Provides rudimentary emulation of destructors.
Code
function expectError($code = '*') {
if (is_array($code)) {
array_push($this->_expected_errors, $code);
}
else {
array_push($this->_expected_errors, array(
$code,
));
}
return sizeof($this->_expected_errors);
}