php try/catch when empty result? 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;
}