diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2013-09-09 15:02:22 -0700 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2013-09-09 15:02:22 -0700 |
commit | e220af8dc07d845efb81082f3159460406ece9ca (patch) | |
tree | 0730a4d27a0aea3e826674c237cb581b56a9dcdc /tests/simple/simple.cpp | |
parent | 49e349c494e0134570a158e56ba8b5b9f26b94f6 (diff) |
work in progress
Diffstat (limited to 'tests/simple/simple.cpp')
-rw-r--r-- | tests/simple/simple.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/tests/simple/simple.cpp b/tests/simple/simple.cpp index a33b220..311ce4c 100644 --- a/tests/simple/simple.cpp +++ b/tests/simple/simple.cpp @@ -15,14 +15,12 @@ */ using namespace std; -static int my_plus(int a, int b) +static Php::Value my_plus(Php::Parameters ¶ms) { - return a + b; -} - -static std::string my_concat(std::string &a, std::string &b) -{ - return a + b; + string p1 = params[0]; + string p2 = params[1]; + + return p1 + p2; } class MyCustomFunction : public Php::Function @@ -45,7 +43,7 @@ extern "C" cout << "b" << endl; // define the functions -// extension.add("my_plus", my_plus); + extension.add("my_plus", my_plus); // extension.add("my_concat", my_concat); extension.add("my_custom", MyCustomFunction()); |