summaryrefslogtreecommitdiff
path: root/documentation
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2015-01-16 13:55:57 +0100
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2015-01-16 13:55:57 +0100
commited34e7ce363c2a29cc807a840cfbe08cfa0f897f (patch)
tree306d6623f2679a8b51df294c81b7b8f93d789973 /documentation
parented7de0678e4d027165fb79f3dabde99cb347886b (diff)
lambda function documentation updates
Diffstat (limited to 'documentation')
-rw-r--r--documentation/lambda-functions.html5
1 files changed, 4 insertions, 1 deletions
diff --git a/documentation/lambda-functions.html b/documentation/lambda-functions.html
index 53cb5b9..4a5a8f4 100644
--- a/documentation/lambda-functions.html
+++ b/documentation/lambda-functions.html
@@ -56,6 +56,9 @@ other_function(function() {
*/
void other_function(Php::Parameters &amp;params)
{
+ // make sure the function was really called with at least one parameter
+ if (params.size() == 0) return nullptr;
+
// this function is called from PHP user space, and it is called
// with a anonymous function as its first parameter
Php::Value func = params[0];
@@ -133,7 +136,7 @@ void run_test()
// create the anonymous function
Php::Function multiply_by_two([](Php::Parameters &amp;params) -> Php::Value) {
- // make sure the function was really called with one parameter
+ // make sure the function was really called with at least one parameter
if (params.size() == 0) return nullptr;
// one parameter is passed to the function