bug32296.phpt 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. --TEST--
  2. Bug #32296 (get_class_methods output has changed between 5.0.2 and 5.0.3)
  3. --FILE--
  4. <?php
  5. abstract class space{
  6. function __construct(){}
  7. abstract protected function unfold();
  8. }
  9. abstract class shape extends space{
  10. private function x1() {}
  11. protected final function unfold(){}
  12. }
  13. abstract class quad extends shape{
  14. private function x2() {}
  15. function buggy(){
  16. $c = get_class($this);
  17. $a = get_class_methods(get_class($this));
  18. $b = get_class_methods($this);
  19. print($c."\n".'a:');
  20. print_r($a);
  21. print('b:');
  22. print_r($b);
  23. }
  24. }
  25. class square extends quad{}
  26. $a = new square();
  27. $a->buggy();
  28. print_r(get_class_methods("square"));
  29. print_r(get_class_methods($a));
  30. ?>
  31. --EXPECT--
  32. square
  33. a:Array
  34. (
  35. [0] => x2
  36. [1] => buggy
  37. [2] => unfold
  38. [3] => __construct
  39. )
  40. b:Array
  41. (
  42. [0] => x2
  43. [1] => buggy
  44. [2] => unfold
  45. [3] => __construct
  46. )
  47. Array
  48. (
  49. [0] => buggy
  50. [1] => __construct
  51. )
  52. Array
  53. (
  54. [0] => buggy
  55. [1] => __construct
  56. )