005.phpt 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. --TEST--
  2. show information about class
  3. --SKIPIF--
  4. <?php
  5. include "skipif.inc";
  6. ?>
  7. --FILE--
  8. <?php
  9. $php = getenv('TEST_PHP_EXECUTABLE');
  10. var_dump(`"$php" -n --rc unknown`);
  11. var_dump(`"$php" -n --rc stdclass`);
  12. var_dump(`"$php" -n --rc exception`);
  13. echo "Done\n";
  14. ?>
  15. --EXPECT--
  16. string(42) "Exception: Class "unknown" does not exist
  17. "
  18. string(183) "Class [ <internal:Core> class stdClass ] {
  19. - Constants [0] {
  20. }
  21. - Static properties [0] {
  22. }
  23. - Static methods [0] {
  24. }
  25. - Properties [0] {
  26. }
  27. - Methods [0] {
  28. }
  29. }
  30. "
  31. string(2232) "Class [ <internal:Core> class Exception implements Stringable, Throwable ] {
  32. - Constants [0] {
  33. }
  34. - Static properties [0] {
  35. }
  36. - Static methods [0] {
  37. }
  38. - Properties [7] {
  39. Property [ protected $message = '' ]
  40. Property [ private string $string = '' ]
  41. Property [ protected $code = 0 ]
  42. Property [ protected string $file = '' ]
  43. Property [ protected int $line = 0 ]
  44. Property [ private array $trace = [] ]
  45. Property [ private ?Throwable $previous = NULL ]
  46. }
  47. - Methods [11] {
  48. Method [ <internal:Core> private method __clone ] {
  49. - Parameters [0] {
  50. }
  51. - Return [ void ]
  52. }
  53. Method [ <internal:Core, ctor> public method __construct ] {
  54. - Parameters [3] {
  55. Parameter #0 [ <optional> string $message = "" ]
  56. Parameter #1 [ <optional> int $code = 0 ]
  57. Parameter #2 [ <optional> ?Throwable $previous = null ]
  58. }
  59. }
  60. Method [ <internal:Core> public method __wakeup ] {
  61. - Parameters [0] {
  62. }
  63. - Tentative return [ void ]
  64. }
  65. Method [ <internal:Core, prototype Throwable> final public method getMessage ] {
  66. - Parameters [0] {
  67. }
  68. - Return [ string ]
  69. }
  70. Method [ <internal:Core, prototype Throwable> final public method getCode ] {
  71. - Parameters [0] {
  72. }
  73. }
  74. Method [ <internal:Core, prototype Throwable> final public method getFile ] {
  75. - Parameters [0] {
  76. }
  77. - Return [ string ]
  78. }
  79. Method [ <internal:Core, prototype Throwable> final public method getLine ] {
  80. - Parameters [0] {
  81. }
  82. - Return [ int ]
  83. }
  84. Method [ <internal:Core, prototype Throwable> final public method getTrace ] {
  85. - Parameters [0] {
  86. }
  87. - Return [ array ]
  88. }
  89. Method [ <internal:Core, prototype Throwable> final public method getPrevious ] {
  90. - Parameters [0] {
  91. }
  92. - Return [ ?Throwable ]
  93. }
  94. Method [ <internal:Core, prototype Throwable> final public method getTraceAsString ] {
  95. - Parameters [0] {
  96. }
  97. - Return [ string ]
  98. }
  99. Method [ <internal:Core, prototype Stringable> public method __toString ] {
  100. - Parameters [0] {
  101. }
  102. - Return [ string ]
  103. }
  104. }
  105. }
  106. "
  107. Done