From da35fa2cb8d454c8e797067e28e647030a5fe5df Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 22 Mar 2019 12:39:27 +0100 Subject: Fixed bug #77772 --- ext/reflection/php_reflection.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'ext/reflection/php_reflection.c') diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index f1096fbe81..80e508c175 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -4246,15 +4246,14 @@ ZEND_METHOD(reflection_class, getMethods) reflection_object *intern; zend_class_entry *ce; zend_long filter = 0; - int argc = ZEND_NUM_ARGS(); + zend_bool filter_is_null = 1; METHOD_NOTSTATIC(reflection_class_ptr); - if (argc) { - if (zend_parse_parameters(argc, "|l", &filter) == FAILURE) { - return; - } - } else { - /* No parameters given, default to "return all" */ + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l!", &filter, &filter_is_null) == FAILURE) { + return; + } + + if (filter_is_null) { filter = ZEND_ACC_PPP_MASK | ZEND_ACC_ABSTRACT | ZEND_ACC_FINAL | ZEND_ACC_STATIC; } @@ -4442,15 +4441,14 @@ ZEND_METHOD(reflection_class, getProperties) reflection_object *intern; zend_class_entry *ce; zend_long filter = 0; - int argc = ZEND_NUM_ARGS(); + zend_bool filter_is_null = 1; METHOD_NOTSTATIC(reflection_class_ptr); - if (argc) { - if (zend_parse_parameters(argc, "|l", &filter) == FAILURE) { - return; - } - } else { - /* No parameters given, default to "return all" */ + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l!", &filter, &filter_is_null) == FAILURE) { + return; + } + + if (filter_is_null) { filter = ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC; } -- cgit v1.2.1