Chapter 16. Java Functions

When Java support is available, a global Java class is defined, which is used to instantiate Java classes into PHP objects. These objects can then be used just as with normal PHP objects; methods of the Java class can be called using PHP syntax, etc. Two functions are also defined to help the programmer deal with Java exceptions, for which PHP has no built-in support. java_last_exception_get() returns an object representing the last exception to have been thrown by a Java class, and java_last_exception_clear() allows the programmer to remove the last exception from memory.

Java support needs to be built into PHP using the --with-java=[DIR] configure option. It will always be built as a shared library, which will be ...

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.