java_last_exception_get

object java_last_exception_get(void) 

Retrieves an exception object describing the last exception thrown by Java.

Returns:

Exception object; NULL if no exceptions are available

Description:

java_last_exception_get() returns an object containing information about the last exception thrown by a Java object in PHP. If no such exception is available, FALSE is returned.

Example:

Force an exception and handle it
 echo "<h2>Testing java.util.StringTokenizer</h2>"; $str = new Java("java.util.StringTokenizer", "This is a test string"); while ($str->hasMoreTokens()) { echo "Got token from string: <b>" . $str->nextToken() . "</b><br />\n"; } echo "<h2>Testing Exceptions</h2>"; echo "This should print out 'No exception':<br />\n"; ...

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.