Bug #15128: php_java array access

From: Date: Mon, 21 Jan 2002 00:28:14 +0000
Subject: Bug #15128: php_java array access
Groups: php.dev 
Request: Send a blank email to php-dev+get-77615@lists.php.net to get a copy of this message
From: paul.schaap@dingoblue.com.au Operating system: Any PHP version: 4.1.1 PHP Bug Type: Feature/Change Request Bug description: php_java array access Hello, Currently under the php_java extension to access array elements you must pull the whole array/hashtable into a php variable before you can access its elements. e.g. r.java ####################################### import java.util.*; public class r { public Hashtable y = new Hashtable(); public void r() { y.put("x","xx"); } } ####################################### <?php $je = new Java("r"); $je->r(); $ht = $je->y; echo $ht["x"]; ?> It would be much nicer (and more php'esque) to access the array and hashtable variables directly like so :- <?php $je = new Java("r"); $je->r(); echo $je->y["x"]; ?> As a trial I ported my custom database access class to Java JDBC with connection pooling, which went very smoothly bar this one difference (I have relied heavily on '$je-> y["x"];' style access in my arrays in my pages). I have had a little stab at figuring out from the source how to implement this, but it is beyond my abilities. Hence my feature request. REGARDS Paul -- Edit bug report at: http://bugs.php.net/?id=15128&edit=1

« previous php.dev (#77615) next »