Menu

Diff of /trunk/php-java-bridge/NEWS [r409] .. [r410]  Maximize  Restore

Switch to side-by-side view

--- a/trunk/php-java-bridge/NEWS
+++ b/trunk/php-java-bridge/NEWS
@@ -4,6 +4,32 @@
 <php-java-bridge-users@lists.sourceforge.net>.
 
 Version 3.0.8:
+
+* When arrays are passed to methods or constructors which accept a
+collection, the bridge now preserves the element order (a TreeMap is
+used as the backing data structure). However, when one of the array
+keys is not an exact number (which means that the php array is not an
+array but a dictionary), the bridge discards the TreeMap and copies
+all bindings into a HashMap data structure and the order of the
+elements is not preserved. Example:
+
+echo new java("java.util.Vector", array(1,2,3));
+=> [o(Vector):"1,2,3"]
+
+echo new java("java.util.Vector", array(1,2,"foo"=>3));
+=> [o(Vector):"3,1,2"]
+
+echo new java("java.util.HashMap", array(1,2,"foo"=>3));
+=> [o(HashMap):{"foo"=3,0=1,1=2}]
+
+* It is now possible to use settype to convert a java value:
+$map = new java("java.util.HashMap", array("one"=>"eins","two"=>"zwei"));
+settype($map, "array"); var_dump($map); 
+=> array("one"=>"eins","two"=>"zwei")
+
+$javaString = new java("java.lang.String", "hello");
+settype($javaString, "string"); echo $javaString;
+=> "hello"
 
 * It is now possible to selectively switch off the servlet pipe
 context server (-Dphp.java.bridge.no_pipe_context_server=true) and the
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.