Make ReflectionClass::getMethods() behave the same ways as
ReflectionClass::getProperties() by not including private methods
from parent classes.
message with traits). (villfa)
. Implement ReflectionProperty::hasDefaultValue and
Reflection::getDefaultValue (beberlei)
+ . Fixed bug #64592 (ReflectionClass::getMethods() returns methods out of
+ scope). (Nikita)
- Session:
. Fixed bug #78624 (session_gc return value for user defined session
/* {{{ _addmethod */
static void _addmethod(zend_function *mptr, zend_class_entry *ce, zval *retval, zend_long filter)
{
+ if ((mptr->common.fn_flags & ZEND_ACC_PRIVATE) && mptr->common.scope != ce) {
+ return;
+ }
+
if (mptr->common.fn_flags & filter) {
zval method;
reflection_method_factory(ce, mptr, NULL, &method);
}
}
Reflecting on class subprivf:
-array(2) {
- [0]=>
- object(ReflectionMethod)#%d (2) {
- ["name"]=>
- string(1) "f"
- ["class"]=>
- string(5) "privf"
- }
- [1]=>
- object(ReflectionMethod)#%d (2) {
- ["name"]=>
- string(1) "s"
- ["class"]=>
- string(5) "privf"
- }
+array(0) {
}
printf("0x%08x\n", $a->getModifiers());
?>
---EXPECTF--
+--EXPECT--
Modifiers for method TestClass::foo():
0x00000001
0x00000011
-Modifiers for method TestClass::priv():
-0x00000004
-
-
Modifiers for method TestClass::prot():
0x00000002