summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorJasperVanEck <jaspergkurtz@gmail.com>2013-11-29 16:44:24 +0100
committerJasperVanEck <jaspergkurtz@gmail.com>2013-11-29 16:44:24 +0100
commit6cff4547a5d104e8366445b44d18b219d020bbec (patch)
treea101fb47d3849c3c3ae44e51b6b291223101fbad /README.md
parent6e8778d6dd0f7295cecf047e57679cba595885d1 (diff)
Update of main README, updated example functions
Diffstat (limited to 'README.md')
-rw-r--r--README.md10
1 files changed, 5 insertions, 5 deletions
diff --git a/README.md b/README.md
index bee84f9..fa213ed 100644
--- a/README.md
+++ b/README.md
@@ -12,9 +12,9 @@ C++, and the PHP-CPP library uses all the power offered by C++11 to convert the
values from your functions to/and from PHP:
```c
-std::string hello_word()
+Php::Value hello_word()
{
- return std::string("hello world!");
+ return "hello world!";
}
```
@@ -22,15 +22,15 @@ The function above is a native C++ function. With PHP-CPP you can export this fu
to PHP with only one single C++ method call:
```c
-extension.function("hello_world", hello_world);
+extension.add("hello_world", hello_world);
```
Working with parameters and return values is just as easy:
```c
-int my_plus(int a, int b)
+Php::Value my_plus(Php::Parameters &params)
{
- return a+b;
+ return params[0] + params[1];
}
```