From 6cff4547a5d104e8366445b44d18b219d020bbec Mon Sep 17 00:00:00 2001 From: JasperVanEck Date: Fri, 29 Nov 2013 16:44:24 +0100 Subject: Update of main README, updated example functions --- README.md | 10 +++++----- 1 file 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 ¶ms) { - return a+b; + return params[0] + params[1]; } ``` -- cgit v1.2.3