diff options
| author | Olly Betts <olly@survex.com> | 2021-03-31 04:49:38 +1300 |
|---|---|---|
| committer | Olly Betts <olly@survex.com> | 2021-03-31 04:49:38 +1300 |
| commit | c9d64f0bed8831bd9d013beb59f1415de32bb756 (patch) | |
| tree | 30d8ab893988219b048550433a7526f2ebab2f43 /Examples/php | |
| parent | 1eab01ad1fc7ffe7abfea66bb5d4be57466e7884 (diff) | |
| download | swig-c9d64f0bed8831bd9d013beb59f1415de32bb756.tar.gz | |
php: Test multiple return values in pointer example
Diffstat (limited to 'Examples/php')
| -rw-r--r-- | Examples/php/pointer/example.i | 9 | ||||
| -rw-r--r-- | Examples/php/pointer/runme.php | 8 |
2 files changed, 7 insertions, 10 deletions
diff --git a/Examples/php/pointer/example.i b/Examples/php/pointer/example.i index 1f0059406..31d2a03e0 100644 --- a/Examples/php/pointer/example.i +++ b/Examples/php/pointer/example.i @@ -21,10 +21,5 @@ extern void sub(int *INPUT, int *INPUT, int *OUTPUT); /* Next we'll use typemaps and the %apply directive */ -//%apply int *OUTPUT { int *r }; -//extern int divide(int n, int d, int *r); - - - - - +%apply int *OUTPUT { int *r }; +extern int divide(int n, int d, int *r); diff --git a/Examples/php/pointer/runme.php b/Examples/php/pointer/runme.php index 824c26dd4..e0ed35b02 100644 --- a/Examples/php/pointer/runme.php +++ b/Examples/php/pointer/runme.php @@ -28,6 +28,8 @@ print " 37 - 42 = $r\n"; # Now try the version with multiple return values - # print "Testing multiple return values\n"; - # ($q,$r) = divide(42,37); - # print " 42/37 = $q remainder $r\n"; + print "Testing multiple return values\n"; + $a = divide(42,37); + $q = $a[0]; + $r = $a[1]; + print " 42/37 = $q remainder $r\n"; |
