ReflectionMethod_defaultArg.phpt 730 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. --TEST--
  2. ReflectionMethod and RECV_INIT (bug #70957 and #70958)
  3. --FILE--
  4. <?php
  5. Abstract class F {
  6. private function bar($a = self::class) {}
  7. }
  8. Trait T
  9. {
  10. private function bar($a = self::class) {}
  11. }
  12. class B {
  13. use T;
  14. }
  15. echo new \ReflectionMethod('F', 'bar');
  16. echo new \ReflectionMethod('T', 'bar');
  17. echo new \ReflectionMethod('B', 'bar');
  18. ?>
  19. --EXPECTF--
  20. Method [ <user> private method bar ] {
  21. @@ %s
  22. - Parameters [1] {
  23. Parameter #0 [ <optional> $a = 'F' ]
  24. }
  25. }
  26. Method [ <user> private method bar ] {
  27. @@ %s
  28. - Parameters [1] {
  29. Parameter #0 [ <optional> $a = self::class ]
  30. }
  31. }
  32. Method [ <user> private method bar ] {
  33. @@ %s
  34. - Parameters [1] {
  35. Parameter #0 [ <optional> $a = self::class ]
  36. }
  37. }