}
MAKE_STD_ZVAL(name);
MAKE_STD_ZVAL(classname);
- ZVAL_STRING(name, method->common.function_name, 1);
+ ZVAL_STRING(name, (method->common.scope && method->common.scope->trait_aliases)?
+ zend_resolve_method_name(ce, method) : method->common.function_name, 1);
ZVAL_STRINGL(classname, method->common.scope->name, method->common.scope->name_length, 1);
reflection_instantiate(reflection_method_ptr, object TSRMLS_CC);
intern = (reflection_object *) zend_object_store_get_object(object TSRMLS_CC);
--- /dev/null
+--TEST--
+Bug #64239 (ReflectionClass::getMethods() changed behavior)
+--FILE--
+<?php
+class A {
+ use T2 { t2method as Bmethod; }
+}
+trait T2 {
+ public function t2method() {
+ }
+}
+
+class B extends A{
+}
+
+$obj = new ReflectionClass("B");
+print_r($obj->getMethods());
+print_r(($method = $obj->getMethod("Bmethod")));
+var_dump($method->getName());
+var_dump($method->getShortName());
+?>
+--EXPECT--
+Array
+(
+ [0] => ReflectionMethod Object
+ (
+ [name] => Bmethod
+ [class] => A
+ )
+
+ [1] => ReflectionMethod Object
+ (
+ [name] => t2method
+ [class] => A
+ )
+
+)
+ReflectionMethod Object
+(
+ [name] => Bmethod
+ [class] => A
+)
+string(7) "Bmethod"
+string(7) "Bmethod"