diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-09-22 13:05:05 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-09-22 13:05:05 +0200 |
commit | 12d087c346592473a4e67e935a892e5f19de88b5 (patch) | |
tree | 1c7404eb9a59cceb67c7e521278e44bb16b2dd3e /Zend/zend_builtin_functions.c | |
parent | fdd9018bdfa6a4b99279a982e7c9d490849c8ae4 (diff) | |
download | php-git-12d087c346592473a4e67e935a892e5f19de88b5.tar.gz |
Use C zpp for get_class_vars()
Diffstat (limited to 'Zend/zend_builtin_functions.c')
-rw-r--r-- | Zend/zend_builtin_functions.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index fbc7d13329..ac652b3b8a 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -747,27 +747,22 @@ static void add_class_vars(zend_class_entry *scope, zend_class_entry *ce, bool s /* {{{ Returns an array of default properties of the class. */ ZEND_FUNCTION(get_class_vars) { - zend_string *class_name; - zend_class_entry *ce, *scope; + zend_class_entry *ce = NULL, *scope; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &class_name) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "C", &ce) == FAILURE) { RETURN_THROWS(); } - ce = zend_lookup_class(class_name); - if (!ce) { - RETURN_FALSE; - } else { - array_init(return_value); - if (UNEXPECTED(!(ce->ce_flags & ZEND_ACC_CONSTANTS_UPDATED))) { - if (UNEXPECTED(zend_update_class_constants(ce) != SUCCESS)) { - return; - } + array_init(return_value); + if (UNEXPECTED(!(ce->ce_flags & ZEND_ACC_CONSTANTS_UPDATED))) { + if (UNEXPECTED(zend_update_class_constants(ce) != SUCCESS)) { + return; } - scope = zend_get_executed_scope(); - add_class_vars(scope, ce, 0, return_value); - add_class_vars(scope, ce, 1, return_value); } + + scope = zend_get_executed_scope(); + add_class_vars(scope, ce, 0, return_value); + add_class_vars(scope, ce, 1, return_value); } /* }}} */ |