bug45765.phpt 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. --TEST--
  2. Fixed bug #45765 (ReflectionObject with default parameters of self::xxx cause an error)
  3. --FILE--
  4. <?php
  5. class foo2 {
  6. const BAR = 'foobar';
  7. }
  8. class foo extends foo2 {
  9. const BAR = "foo's bar";
  10. function test($a = self::BAR) {
  11. }
  12. function test2($a = parent::BAR) {
  13. }
  14. function test3($a = foo::BAR) {
  15. }
  16. function test4($a = foo2::BAR) {
  17. }
  18. }
  19. echo new ReflectionObject(new foo);
  20. ?>
  21. --EXPECTF--
  22. Object of class [ <user> class foo extends foo2 ] {
  23. @@ %s 7-21
  24. - Constants [1] {
  25. Constant [ public string BAR ] { foo's bar }
  26. }
  27. - Static properties [0] {
  28. }
  29. - Static methods [0] {
  30. }
  31. - Properties [0] {
  32. }
  33. - Dynamic properties [0] {
  34. }
  35. - Methods [4] {
  36. Method [ <user> public method test ] {
  37. @@ %s 10 - 11
  38. - Parameters [1] {
  39. Parameter #0 [ <optional> $a = self::BAR ]
  40. }
  41. }
  42. Method [ <user> public method test2 ] {
  43. @@ %s 13 - 14
  44. - Parameters [1] {
  45. Parameter #0 [ <optional> $a = parent::BAR ]
  46. }
  47. }
  48. Method [ <user> public method test3 ] {
  49. @@ %s 16 - 17
  50. - Parameters [1] {
  51. Parameter #0 [ <optional> $a = foo::BAR ]
  52. }
  53. }
  54. Method [ <user> public method test4 ] {
  55. @@ %s 19 - 20
  56. - Parameters [1] {
  57. Parameter #0 [ <optional> $a = foo2::BAR ]
  58. }
  59. }
  60. }
  61. }