diff options
author | JasperVanEck <jaspergkurtz@gmail.com> | 2013-11-29 16:44:24 +0100 |
---|---|---|
committer | JasperVanEck <jaspergkurtz@gmail.com> | 2013-11-29 16:44:24 +0100 |
commit | 6cff4547a5d104e8366445b44d18b219d020bbec (patch) | |
tree | a101fb47d3849c3c3ae44e51b6b291223101fbad /README.md | |
parent | 6e8778d6dd0f7295cecf047e57679cba595885d1 (diff) |
Update of main README, updated example functions
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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 ¶ms) { - return a+b; + return params[0] + params[1]; } ``` |