summaryrefslogtreecommitdiff
path: root/tests/simple/simple.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/simple/simple.cpp')
-rw-r--r--tests/simple/simple.cpp14
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 &params)
{
- 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());