From: Felipe Pena Date: Wed, 6 Jul 2011 00:33:38 +0000 (+0000) Subject: - Fixed bug #55137 (Changing trait static method visibility) X-Git-Tag: php-5.4.0alpha2~45 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8953916314338b40c1304972b799c80c79f59683;p=php - Fixed bug #55137 (Changing trait static method visibility) --- diff --git a/Zend/tests/bug55137.phpt b/Zend/tests/bug55137.phpt new file mode 100644 index 0000000000..4a4e6e61a2 --- /dev/null +++ b/Zend/tests/bug55137.phpt @@ -0,0 +1,26 @@ +--TEST-- +Bug #55137 (Changing trait static method visibility) +--FILE-- + +--EXPECT-- +abc +def diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 5f9cef311b..f3b6b77718 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -3661,6 +3661,7 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args, if (!(aliases[i]->modifiers & ZEND_ACC_PPP_MASK)) { fn_copy.common.fn_flags |= ZEND_ACC_PUBLIC; } + fn_copy.common.fn_flags |= fn->common.fn_flags ^ (fn->common.fn_flags & ZEND_ACC_PPP_MASK); } lcname_len = aliases[i]->alias_len; @@ -3700,6 +3701,7 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args, if (!(aliases[i]->modifiers & ZEND_ACC_PPP_MASK)) { fn_copy.common.fn_flags |= ZEND_ACC_PUBLIC; } + fn_copy.common.fn_flags |= fn->common.fn_flags ^ (fn->common.fn_flags & ZEND_ACC_PPP_MASK); } } i++;