java_last_exception_clear

void java_last_exception_clear(void) 

Clears the last exception raised by a Java object.

Returns:

NULL

Description:

java_last_exception_clear() removes the last stored exception from the PHP Java environment. If you need to examine the last exception first, you can get an object describing the exception by calling java_last_exception_get().

Note:

Exceptions are not cleared automatically at the end of PHP script execution; this has to do with the way that PHP and the JavaVirtual Machine interact. This means that if an exception occurs on one page and is not cleared, it could show up on another page. Be sure to clear your exceptions.

Example:

Force an exception and handle it
 echo "<h2>Testing java.util.StringTokenizer</h2>"; ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.