diff options
Diffstat (limited to 'tests/simple')
-rw-r--r-- | tests/simple/simple.cpp | 10 | ||||
-rw-r--r-- | tests/simple/simple.php | 7 |
2 files changed, 15 insertions, 2 deletions
diff --git a/tests/simple/simple.cpp b/tests/simple/simple.cpp index 2ab177f..dede458 100644 --- a/tests/simple/simple.cpp +++ b/tests/simple/simple.cpp @@ -15,10 +15,18 @@ */ using namespace std; -static Php::Value my_plus(Php::Parameters ¶ms) +static Php::Value my_plus(Php::Environment &env, Php::Parameters ¶ms) { string p1 = params[0]; string p2 = params[1]; + + cout << "global g1: " << env["g1"].stringValue() << endl; + cout << "global g2: " << env["g2"].stringValue() << endl; + + Php::Global g(env["g3"]); + + g = "zo kan het ook"; + return p1 + p2; } diff --git a/tests/simple/simple.php b/tests/simple/simple.php index 6f70a7a..af9a2a2 100644 --- a/tests/simple/simple.php +++ b/tests/simple/simple.php @@ -18,11 +18,16 @@ class MyClass { } } +$g1 = 123; +$g2 = "abc"; + $result = my_plus(new MyClass(), array(), new MyClass(), $myvar, "blabla", new XXX()); echo("myvar = $myvar\n"); echo("resultaat: $result\n"); -print_r($result); +echo("g1: $g1\n"); +echo("g2: $g2\n"); +echo("g3: $g3\n"); |