From: Dmitry Stogov Date: Wed, 27 Apr 2005 13:30:53 +0000 (+0000) Subject: Fixed bug #29104 (Function declaration in method doesn't work) X-Git-Tag: php-5.0.1b1~399 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=abb07db4c6359d15a0ab9d8c8735c5a93ac429a6;p=php Fixed bug #29104 (Function declaration in method doesn't work) --- diff --git a/Zend/tests/bug29104.phpt b/Zend/tests/bug29104.phpt new file mode 100644 index 0000000000..c7afbee073 --- /dev/null +++ b/Zend/tests/bug29104.phpt @@ -0,0 +1,27 @@ +--TEST-- +Bug #29104 Function declaration in method doesn't work +--FILE-- +g(); +f(); +?> +--EXPECT-- +function g - begin +function g - end +function f diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index d3ee2c3f02..de876333d0 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -1039,7 +1039,7 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n op_array.fn_flags = fn_flags; op_array.pass_rest_by_reference = 0; - op_array.scope = CG(active_class_entry); + op_array.scope = is_method?CG(active_class_entry):NULL; op_array.prototype = NULL; op_array.line_start = zend_get_compiled_lineno(TSRMLS_C);