|
From: <php...@li...> - 2007-08-15 15:41:37
|
I tried that, but it doesn't work. $array will wind up as a php array with
$count elements:
// trying to create 3-element String[] in PHP4
$Array = new JavaClass("java.lang.reflect.Array");
$String = new JavaClass("java.lang.String");
$javaArr = $Array->newInstance($String, 3);
var_dump($javaArr);
Output:
array(3) {
[0]=>
NULL
[1]=>
NULL
[2]=>
NULL
}
Michael.
> -----Original Message-----
> From: php...@li... [mailto:php-
> jav...@li...] On Behalf Of php-java-
> bri...@li...
> Sent: Wednesday, August 15, 2007 5:00 AM
> To: php...@li...
> Subject: Re: [Php-java-bridge-users] coerce sub-array as Java array
>
> Why don't you create a string array explicitly, for example by using
> java.reflect.Array?
>
> The code would look like this:
>
> $array = java("java.reflect.Array")-
> >newInstance(java("java.lang.String"), $count);
>
> Please see the documentation for details: http://php-java-
> bridge.sourceforge.net/pjb/extension_mappings.php
>
>
> __________________________________
> Alles was der Gesundheit und Entspannung dient. BE A BETTER MEDIZINMANN!
> www.yahoo.de/clever
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> php-java-bridge-users mailing list
> php...@li...
> https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
|