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;
}
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;
}
--- /dev/null
+--TEST--
+Bug #77772: ReflectionClass::getMethods(null) doesn't work
+--FILE--
+<?php
+
+class Test {
+ public $prop;
+ public function method() {}
+}
+
+$rc = new ReflectionClass(Test::class);
+foreach ($rc->getMethods(null) as $method) {
+ var_dump($method->getName());
+}
+foreach ($rc->getProperties(null) as $prop) {
+ var_dump($prop->getName());
+}
+
+?>
+--EXPECT--
+string(6) "method"
+string(4) "prop"