diff options
author | Johannes Schlüter <johannes@php.net> | 2007-04-12 18:39:46 +0000 |
---|---|---|
committer | Johannes Schlüter <johannes@php.net> | 2007-04-12 18:39:46 +0000 |
commit | bbcd8c5b693e84483ee15bde2c683c8e6ee8c875 (patch) | |
tree | c119de44619cd22be0815d60ccd7b8218222ff84 /ext/reflection/php_reflection.c | |
parent | 9f2022743ba606522b458fc9a98141ae10b81db7 (diff) | |
download | php-git-bbcd8c5b693e84483ee15bde2c683c8e6ee8c875.tar.gz |
- Fix bug #41061 ("visibility error" in ReflectionFunction::export())
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r-- | ext/reflection/php_reflection.c | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index f974d53f4c..258f8e5e14 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -747,23 +747,27 @@ static void _function_string(string *str, zend_function *fptr, zend_class_entry string_printf(str, "static "); } - /* These are mutually exclusive */ - switch (fptr->common.fn_flags & ZEND_ACC_PPP_MASK) { - case ZEND_ACC_PUBLIC: - string_printf(str, "public "); - break; - case ZEND_ACC_PRIVATE: - string_printf(str, "private "); - break; - case ZEND_ACC_PROTECTED: - string_printf(str, "protected "); - break; - default: - string_printf(str, "<visibility error> "); - break; + if (fptr->common.scope) { + /* These are mutually exclusive */ + switch (fptr->common.fn_flags & ZEND_ACC_PPP_MASK) { + case ZEND_ACC_PUBLIC: + string_printf(str, "public "); + break; + case ZEND_ACC_PRIVATE: + string_printf(str, "private "); + break; + case ZEND_ACC_PROTECTED: + string_printf(str, "protected "); + break; + default: + string_printf(str, "<visibility error> "); + break; + } + string_printf(str, "method "); + } else { + string_printf(str, "function "); } - string_printf(str, fptr->common.scope ? "method " : "function "); if (fptr->op_array.return_reference) { string_printf(str, "&"); } |