Everyone here should know the \'or\' statemens, usually glued to an die() command:
$foo = bar() or die(\'Error: bar function return false.\');
Here's a single-line solution without the extra function:
if (!($foo = bar())) throw new Exception('We have a problem here');