summaryrefslogtreecommitdiff
path: root/ext/reflection/tests/bug64239.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/reflection/tests/bug64239.phpt')
-rw-r--r--ext/reflection/tests/bug64239.phpt44
1 files changed, 44 insertions, 0 deletions
diff --git a/ext/reflection/tests/bug64239.phpt b/ext/reflection/tests/bug64239.phpt
new file mode 100644
index 000000000..9acdc1987
--- /dev/null
+++ b/ext/reflection/tests/bug64239.phpt
@@ -0,0 +1,44 @@
+--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"