note 111430 modified in exception.getcode by danbrown
| From: | danbrown@php.net | Date: | Mon, 04 Mar 2013 18:02:55 +0000 |
| Subject: | note 111430 modified in exception.getcode by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-193873@lists.php.net to get a copy of this message | ||
when raising an Exception with no error code explicitly defined, getCode() returns the integer 0
<?php
try {
throw new Exception("no code!!");
} catch (Exception $e) {
print("Code='" . $e->getCode() . "'");
}
?>
outputs
Code='0'
--was--
when raising an Exception with no error code explicitly defined, getCode() returns the integer 0
try {
throw new Exception("no code!!");
} catch (Exception $e) {
print("Code='" . $e->getCode() . "'");
}
outputs
Code='0'
http://php.net/manual/en/exception.getcode.php