diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2013-12-07 13:12:25 -0800 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2013-12-07 13:12:25 -0800 |
commit | 80c8a16fb145f7ed4867d31fad3c22318a1ce708 (patch) | |
tree | f7605cdb86d653efaac761363ed596dd6b2e0459 /Examples/Globals/globals.php | |
parent | 964d6274b0eba38df43d77b87c44bd728d2f0fb5 (diff) |
replaces tabs in source code with regular spaces, added example for working with global variables
Diffstat (limited to 'Examples/Globals/globals.php')
-rw-r--r-- | Examples/Globals/globals.php | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Examples/Globals/globals.php b/Examples/Globals/globals.php new file mode 100644 index 0000000..36febf6 --- /dev/null +++ b/Examples/Globals/globals.php @@ -0,0 +1,29 @@ +<?php +/* + * globals.php + * @author Jasper van Eck<jasper.vaneck@copernica.com> + * + * An example file to show the working of a void function call. + */ + +// we first need to set a number of globals +$b = 10; +$d = function($a,$b,$c) { + return $a+$b+$c; +}; + +// call the C++ function that will do something +$d = process_globals(); + +// the global variable $a should not have the value 1 +echo("a = $a\n"); + +// the variable $b should not be 11 +echo("b = $b\n"); + +// $c should be an array +echo("c['member'] = ".$c['member']."\n"); + +// $d is overwritten and now is 6 +echo("d = $d\n"); + |