summaryrefslogtreecommitdiff
path: root/Examples/simple
diff options
context:
space:
mode:
authorJasperVanEck <jaspergkurtz@gmail.com>2013-11-28 11:31:23 +0100
committerJasperVanEck <jaspergkurtz@gmail.com>2013-11-28 11:31:23 +0100
commit0fdfc4ced15ed29c407ad95cb0e1224711c1919d (patch)
tree1c288b5591407f496d735daf15461ff117cd8355 /Examples/simple
parentd8a1c0e46c39bce675d6322cd0bfa0f1f5ba3166 (diff)
Added extension and functionvoid exmaple
Diffstat (limited to 'Examples/simple')
-rw-r--r--Examples/simple/simple.cpp23
1 files changed, 18 insertions, 5 deletions
diff --git a/Examples/simple/simple.cpp b/Examples/simple/simple.cpp
index 7942a3c..7dc9305 100644
--- a/Examples/simple/simple.cpp
+++ b/Examples/simple/simple.cpp
@@ -73,13 +73,26 @@ Php::Value bubblesort(Php::Parameters &params)
return r;
}
+
+void my_function()
+{
+
+}
+
+Php::Value my_integer_return()
+{
+ throw Php::Exception("er is iets mis");
+
+ return "abcd";
+}
+
/**
* Our own "my_plus" function that will be available in PHP
* @param environment
* @param params
* @return Value
*/
-static Php::Value my_plus(Php::Environment &env, Php::Parameters &params)
+static Php::Value my_plus(Php::Parameters &params)
{
Php::Value r(0);
@@ -159,10 +172,10 @@ extern "C"
// define the functions
extension.add("my_plus", my_plus, {
-// Php::ByVal("a", Php::numericType),
-// Php::ByVal("b", Php::numericType)
-// Php::ByVal("c", "MyClass"),
-// Php::ByRef("d", Php::stringType)
+ Php::ByVal("a", Php::numericType),
+ Php::ByVal("b", Php::numericType)
+ Php::ByVal("c", "MyClass"),
+ Php::ByRef("d", Php::stringType)
});
extension.add("bubblesort", bubblesort);