php exception handling which is inside method code example
Example: php throw exception
function inverse($x) {
if (!$x) {
throw new Exception('Division by zero.');
}
return 1/$x;
}
function inverse($x) {
if (!$x) {
throw new Exception('Division by zero.');
}
return 1/$x;
}