PageRenderTime 50ms CodeModel.GetById 8ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/Examples/php/funcptr/runme.php

#
PHP | 24 lines | 16 code | 7 blank | 1 comment | 0 complexity | 16ead77cea513f7855ba87049da441da MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. <?php
  2. require "example.php";
  3. $a = 37;
  4. $b = 42;
  5. # Now call our C function with a bunch of callbacks
  6. print "Trying some C callback functions\n";
  7. print " a = $a\n";
  8. print " b = $b\n";
  9. print " ADD(a,b) = ". do_op($a,$b,ADD)."\n";
  10. print " SUB(a,b) = ". do_op($a,$b,SUB)."\n";
  11. print " MUL(a,b) = ". do_op($a,$b,MUL)."\n";
  12. print "Here is what the C callback function objects look like in php\n";
  13. print "Using swig style string pointers as we need them registered as constants\n";
  14. print " ADD = " . ADD . "\n";
  15. print " SUB = " . SUB . "\n";
  16. print " MUL = " . MUL . "\n";
  17. ?>