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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access