--- a/trunk/php-java-bridge/ABOUT.HTM +++ b/trunk/php-java-bridge/ABOUT.HTM @@ -417,11 +417,6 @@ }<br> ...<br> die("unexpected exception: $ex");<br> - } - try {<br> - new java("java.lang.String", null);<br> - } catch(JavaException $ex) {<br> - rethrow($ex);<br> }<br> </code> </blockquote>
--- a +++ b/trunk/php-java-bridge/tests.php5/TestClass.java @@ -0,0 +1,5 @@ +public class TestClass { + public String getName() { + return "test clazz"; + } +} \ No newline at end of file
--- a +++ b/trunk/php-java-bridge/tests.php5/testClass2.php @@ -0,0 +1,26 @@ +#!/usr/bin/php + +<?php +if (!extension_loaded('java')) { + if (!(include_once("java/Java.php"))&&!(PHP_SHLIB_SUFFIX=="so" && dl('java.so'))&&!(PHP_SHLIB_SUFFIX=="dll" && dl('php_java.dll'))) { + echo "java extension not installed."; + exit(2); + } +} + +$here=realpath(dirname($_SERVER["SCRIPT_FILENAME"])); +if(!$here) $here=getcwd(); +java_require("$here/testClass.jar"); + +/* See PR1616498 */ +try { + $obj = new Java("TestClass"); + $cls = $obj->getClass(); + $name = $cls->getName(); + $objname = $obj->getName(); //this fails in 3.1.8 due to a cache problem +} catch (JavaException $e) { + echo "test failed"; + exit(1); +} +exit(0); +?>