From d5ef2f466cb112fd977a71419fa4b67d0aa0a2ac Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Mon, 14 Jul 2008 09:49:03 +0000 Subject: Added support for lambda functions and closures --- Zend/zend_API.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Zend/zend_API.c') diff --git a/Zend/zend_API.c b/Zend/zend_API.c index d8f627adad..68f0c7880c 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -26,6 +26,7 @@ #include "zend_modules.h" #include "zend_constants.h" #include "zend_exceptions.h" +#include "zend_closures.h" #ifdef HAVE_STDARG_H #include @@ -2615,6 +2616,16 @@ ZEND_API zend_bool zend_is_callable_ex(zval *callable, uint check_flags, char ** } return 0; + case IS_OBJECT: + if (zend_get_closure(callable, ce_ptr, fptr_ptr, NULL, zobj_ptr_ptr TSRMLS_CC) == SUCCESS) { + if (callable_name) { + *callable_name_len = strlen((*fptr_ptr)->common.function_name); + *callable_name = estrndup((*fptr_ptr)->common.function_name, *callable_name_len); + } + return 1; + } + /* break missing intentionally */ + default: if (callable_name) { zval expr_copy; -- cgit v1.2.1