Possible Duplicate:
PHP: 'or' statement on instruction fail: how to throw a new exception?
In PHP, especially popular amongst the newbies in various MySQL connection tutorials, you've always been able to do something like this...
<?php
foo() or die('foo() failed!');
?>
However if I try something like this it fails...
<?php
foo() or throw new Exception('AHH!');
?>
Like so...
"Parse error: syntax error, unexpected 'throw' (T_THROW) in..."
Anybody know how to do something similar to this? Would I have to set a variable after the "or"?