* Evaluate a object and fetch its content, if possible. Use java_values() to convert a Java object into an equivalent PHP value.
*
* A java array, Map or Collection object is returned
* as a php array. An array, Map or Collection proxy is returned as a java array, Map or Collection object, and a null proxy is returned as null. All values of java types for which a primitive php type exists are returned as php values. Everything else is returned unevaluated. Please make sure that the values do not not exceed
* When java_session() is called with a second argument set to true,
* a new session is allocated, the old session is destroyed if necessary.
* Example:
* <code>
* java_session(null, true)->put("key", "val");
* </code>
*
* The optional third argument specifies the default lifetime of the session, it defaults to <code> session.gc_maxlifetime </code>. The value 0 means that the session never times out.
*
* The synchronized init() and onShutdown() callbacks from
* java_context() and the JPersistenceAdapter (see
* JPersistenceAdapter.php from the php_java_lib directory) may also
* be useful to load a Java singleton object after the JavaBridge
* library has been initialized, and to store it right before the web
* ScriptEngine e = new ScriptEngineManager().getEngineByName("php-invocable");
* e.eval (s);
* Thread t = new Thread((Runnable)e.get("php.java.bridge.PhpProcedure"));
* t.join ();
* ((Closeable)e).close ();
* </code>
*
* A synchronized init() procedure can be called from the context to initialize a library once, and a shutdown hook can be registered to destroy the library before the (web-) context is destroyed. The init hook can be written in PHP, but the shutdown hook must be written in Java. Example:
* <code>
* function getShutdownHook() { return java("myJavaHelper")->getShutdownHook(); }