Menu

[r641]: / trunk / php-java-bridge / tests.mono+net / load_assembly.php  Maximize  Restore  History

Download this file

38 lines (24 with data), 663 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php require_once("Mono.inc");
$here=getcwd();
mono_require("$here/sample_lib.dll");
$ArrayToString=new MonoClass("sample.ArrayToString");
// create long array ...
$length=10;
for($i=0; $i<$length; $i++) {
$arr[$i]=$i;
}
// ... and post it to the VM. Should print integers
print "integer array: ". $ArrayToString->Convert($arr) . "\n";
// double
for($i=0; $i<$length; $i++) {
$arr[$i]=$i +1.23;
}
// should print doubles
print "double array: ". $ArrayToString->Convert($arr) . "\n";
// boolean
for($i=0; $i<$length; $i++) {
$arr[$i]=$i%2?true:false;
}
// should print booleans
print "boolean array: ". $ArrayToString->Convert($arr) ."\n";
?>