Why doesn the bridge throw a java.lang.RuntimeException or Error as a PHP JavaException by default?
All exceptions crossing the php/java container must be declared. If you want to catch java.lang.RuntimeException or java.lang.Error from PHP code, add a “throws” declaration. Example: public Object calculateValue(…) throws RuntimeException; It is a good programming practice to not allow java.lang.RuntimeException and java.lang.Error to cross an application container boundary. A JEE “enterprise java beans” container for example will terminate a transaction immediately if it encounters an exception derived from Error or RuntimeException. However, since PHP/Java Bridge version 5.5.3 the bridge reports a java.lang.RuntimeException/Error as a PHP JavaException if the option JAVA_PREFER_VALUES is set. Please see the NEWS entry for version 5.5.3 from the PHP/Java Bridge documentation download for details.