bug64239.phpt 737 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. --TEST--
  2. Bug #64239 (ReflectionClass::getMethods() changed behavior)
  3. --FILE--
  4. <?php
  5. class A {
  6. use T2 { t2method as Bmethod; }
  7. }
  8. trait T2 {
  9. public function t2method() {
  10. }
  11. }
  12. class B extends A{
  13. }
  14. $obj = new ReflectionClass("B");
  15. print_r($obj->getMethods());
  16. print_r(($method = $obj->getMethod("Bmethod")));
  17. var_dump($method->getName());
  18. var_dump($method->getShortName());
  19. ?>
  20. --EXPECT--
  21. Array
  22. (
  23. [0] => ReflectionMethod Object
  24. (
  25. [name] => Bmethod
  26. [class] => A
  27. )
  28. [1] => ReflectionMethod Object
  29. (
  30. [name] => t2method
  31. [class] => A
  32. )
  33. )
  34. ReflectionMethod Object
  35. (
  36. [name] => Bmethod
  37. [class] => A
  38. )
  39. string(7) "Bmethod"
  40. string(7) "Bmethod"