PageRenderTime 11ms CodeModel.GetById 1ms app.highlight 4ms RepoModel.GetById 2ms app.codeStats 0ms

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

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