import source from 1.3.40
[external/swig.git] / Examples / php / pointer / runme.php
1 <?php
2
3         require "example.php";
4
5         # First create some objects using the pointer library.
6
7         print "Testing the pointer library\n";
8
9         $a = 37.145;
10         $b = 42.555;
11         $c = "";  // $c must be defined and not null.
12
13         print " a = $a\n";
14         print " b = $b\n";
15         print " c = $c\n";
16
17         # Call the add() function wuth some pointers
18         add(&$a,&$b,&$c);
19
20         print " $a + $b = $c\n";
21
22         # Now try the typemap library
23         # This should be much easier. Now how it is no longer
24         # necessary to manufacture pointers.
25
26         print "Trying the typemap library\n";
27         $r = sub(37,42);
28         print " 37 - 42 = $r\n";
29
30         # Now try the version with multiple return values
31         # print "Testing multiple return values\n";
32         # ($q,$r) = divide(42,37);
33         # print "       42/37 = $q remainder $r\n";
34
35 ?>