php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #15128 php_java array access
Submitted: 2002-01-20 19:28 UTC Modified: 2010-12-03 17:29 UTC
From: paul dot schaap at dingoblue dot com dot au Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 4.1.1 OS: Any
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: paul dot schaap at dingoblue dot com dot au
New email:
PHP Version: OS:

 

 [2002-01-20 19:28 UTC] paul dot schaap at dingoblue dot com dot au
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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-12-03 17:29 UTC] jani@php.net
-Status: Open +Status: Bogus -Package: Feature/Change Request +Package: *General Issues
 [2010-12-03 17:29 UTC] jani@php.net
There is no php_java anymore, at least in PHP core.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed May 07 15:01:31 2025 UTC