diff options
author | JasperVanEck <jaspergkurtz@gmail.com> | 2013-12-02 12:28:32 +0100 |
---|---|---|
committer | JasperVanEck <jaspergkurtz@gmail.com> | 2013-12-02 12:28:32 +0100 |
commit | 040f493080df2787557b891713d5f851ac78cae6 (patch) | |
tree | 00a848964c7191a18fa3d1af4042866c1edf18e7 /Examples/CallPhpFunctions/callphpfunction.php | |
parent | c97224558d022b5698fb000018f910f2499df1b4 (diff) |
isCallable now works
Diffstat (limited to 'Examples/CallPhpFunctions/callphpfunction.php')
-rw-r--r-- | Examples/CallPhpFunctions/callphpfunction.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Examples/CallPhpFunctions/callphpfunction.php b/Examples/CallPhpFunctions/callphpfunction.php index 26f161c..ae3cf81 100644 --- a/Examples/CallPhpFunctions/callphpfunction.php +++ b/Examples/CallPhpFunctions/callphpfunction.php @@ -6,11 +6,13 @@ * An example file to show the working of a php function call in C++. */ -/* - * Run the function with the given name. As you can see, the given name - * can be different from the actual function name. +/** + * Call a C++ function with a callable PHP function as its parameter. + * The PHP function is then executed from the C++ code. + * The PHP function is this case, adds three numbers. */ $result = call_php_function(function($a, $b, $c){ - return $a + $b + $c; + return $a + $b + $c; }); -echo $result; +// print the result +echo $result . "\n"; |