if ($result = anyFunc($var)) {
return $result;
}
$resultForFunc = anyFunc($var);
if (!empty($resultForFunc)) {
return $resultForFunc
}
function anyFunc($var) {
// some code there
if (!$result) {
throw new Exception('result not builded');
}
}
try {
return anyFunc($var)
}
catch (\Exception $e) {
// log
}