This is just a quick one regarding exception handling when using the ? operator.
I have overloaded the default exception class and created a custom one, however i want to throw an exception using the following.
Code:
Code: Select all
try{
$uObj = NULL;
empty($uObj) ? $this->uObj = $uObj : throw new EAPIException('No User Object Defined',501);
}catch(EAPIException($e){
print $e;
}For some reason this doesnt seem to work, nor does it generate an error in my error.log
There is very little info on the usage of ? :, so i thought id ask.
cheers.