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'
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'