Menu

[r321]: / trunk / php-java-bridge / tests.php4 / sendArray.php  Maximize  Restore  History

Download this file

18 lines (15 with data), 401 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
#!/usr/bin/php
<?php
if (!extension_loaded('java')) {
if (!(PHP_SHLIB_SUFFIX=="so" && dl('java.so'))&&!(PHP_SHLIB_SUFFIX=="dll" && dl('php_java.dll'))) {
echo "java extension not installed.";
exit(2);
}
}
$ar=array(1, 2, 3);
$v=new java("java.util.Vector", $ar);
$Arrays=new java_class("java.util.Arrays");
$l=$Arrays->asList($ar);
echo $l->size() . " " . $v->capacity();
echo "\n";
?>