Expression: Exception Operations
Throwing Exceptions
Exceptions are thrown using the throw
keyword. The expression after the throw
keyword is the exception to be thrown. The exception must a subtype of Throwable
.
throw $exception;
throw new Exception();