Just found out about the abbreviated ternary operator and was expecting the following:
$dbh =new PDO('mysql:blad','user','pass'); (!$dbh) ? throw new Exception('Error connecting to database'); : return $dbh;
Instead, I get the following error:
parse error: syntax error, unexpected T_THROW in...
Any ideas for the right syntax?
thanks
source share