summaryrefslogtreecommitdiff
path: root/ext/reflection/php_reflection.c
diff options
context:
space:
mode:
authorMáté Kocsis <kocsismate@woohoolabs.com>2020-09-29 09:19:45 +0200
committerMáté Kocsis <kocsismate@woohoolabs.com>2020-09-29 11:04:10 +0200
commit351776eae583d3dc352a4b3e8f4e4a639f8c59ec (patch)
treeb6358d380469d7480493aad715e0279538f75f13 /ext/reflection/php_reflection.c
parente19599287eb7c41f9cb7ecbff8f3a363b15971e9 (diff)
downloadphp-git-351776eae583d3dc352a4b3e8f4e4a639f8c59ec.tar.gz
Make the $filter parameter of ReflectionClass::get*Constants() nullable
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r--ext/reflection/php_reflection.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index d4f89be69f..7b9c37d1eb 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -4190,7 +4190,7 @@ ZEND_METHOD(ReflectionClass, getMethods)
reflection_object *intern;
zend_class_entry *ce;
zend_function *mptr;
- zend_long filter = 0;
+ zend_long filter;
zend_bool filter_is_null = 1;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l!", &filter, &filter_is_null) == FAILURE) {
@@ -4366,7 +4366,7 @@ ZEND_METHOD(ReflectionClass, getProperties)
zend_class_entry *ce;
zend_string *key;
zend_property_info *prop_info;
- zend_long filter = 0;
+ zend_long filter;
zend_bool filter_is_null = 1;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l!", &filter, &filter_is_null) == FAILURE) {
@@ -4422,12 +4422,17 @@ ZEND_METHOD(ReflectionClass, getConstants)
zend_string *key;
zend_class_constant *constant;
zval val;
- zend_long filter = ZEND_ACC_PPP_MASK;
+ zend_long filter;
+ zend_bool filter_is_null = 1;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &filter) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l!", &filter, &filter_is_null) == FAILURE) {
RETURN_THROWS();
}
+ if (filter_is_null) {
+ filter = ZEND_ACC_PPP_MASK;
+ }
+
GET_REFLECTION_OBJECT_PTR(ce);
array_init(return_value);
@@ -4452,12 +4457,17 @@ ZEND_METHOD(ReflectionClass, getReflectionConstants)
zend_class_entry *ce;
zend_string *name;
zend_class_constant *constant;
- zend_long filter = ZEND_ACC_PPP_MASK;
+ zend_long filter;
+ zend_bool filter_is_null = 1;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &filter) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l!", &filter, &filter_is_null) == FAILURE) {
RETURN_THROWS();
}
+ if (filter_is_null) {
+ filter = ZEND_ACC_PPP_MASK;
+ }
+
GET_REFLECTION_OBJECT_PTR(ce);
array_init(return_value);