Everyone here should know the \'or\' statemens, usually glued to an die() command:
$foo = bar() or die(\'Error: bar function return false.\');
Why don't bar() and bb() throw the exceptions? In PHP Exceptions bubble up, so there's no need to throw the exception in the function/method where you call bar()/bb(). These exceptions may be thrown by bar()/bb(). In case you want to throw another exception, you can simply do:
function foo() {
try {
$bar = bar();
} catch (BarException) {
throw new FooException;
}
}