From: Felipe Pena Date: Sun, 28 Jun 2009 01:14:28 +0000 (+0000) Subject: - Fixed bug #48693 (Double declaration of __lambda_func when lambda wrongly formatted) X-Git-Tag: php-5.4.0alpha1~191^2~3231 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e2e5c765f8ba2e3ba289a8d09e75185d249cab19;p=php - Fixed bug #48693 (Double declaration of __lambda_func when lambda wrongly formatted) --- diff --git a/Zend/tests/bug48693.phpt b/Zend/tests/bug48693.phpt new file mode 100644 index 0000000000..e574346029 --- /dev/null +++ b/Zend/tests/bug48693.phpt @@ -0,0 +1,28 @@ +--TEST-- +Bug #48693 (Double declaration of __lambda_func when lambda wrongly formatted) +--FILE-- + +--EXPECTF-- +Parse error: syntax error, unexpected '}' in %s(%d) : runtime-created function on line 1 + +Parse error: syntax error, unexpected $end in %s(%d) : runtime-created function on line 1 +bool(false) +int(2) +bool(false) +int(3) +bool(true) diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index ca054f3086..dba4b5ca44 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -1794,6 +1794,7 @@ ZEND_FUNCTION(create_function) zend_hash_del(EG(function_table), LAMBDA_TEMP_FUNCNAME, sizeof(LAMBDA_TEMP_FUNCNAME)); RETURN_ASCII_STRINGL(function_name, function_name_length, 0); } else { + zend_hash_del(EG(function_table), LAMBDA_TEMP_FUNCNAME, sizeof(LAMBDA_TEMP_FUNCNAME)); RETURN_FALSE; } }