ReflectionClass_toString_001.phpt 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438
  1. --TEST--
  2. ReflectionClass::__toString()
  3. --CREDITS--
  4. Robin Fernandes <robinf@php.net>
  5. Steve Seear <stevseea@php.net>
  6. --FILE--
  7. <?php
  8. $rc = new ReflectionClass("ReflectionClass");
  9. echo $rc;
  10. ?>
  11. --EXPECT--
  12. Class [ <internal:Reflection> class ReflectionClass implements Stringable, Reflector ] {
  13. - Constants [3] {
  14. Constant [ public int IS_IMPLICIT_ABSTRACT ] { 16 }
  15. Constant [ public int IS_EXPLICIT_ABSTRACT ] { 64 }
  16. Constant [ public int IS_FINAL ] { 32 }
  17. }
  18. - Static properties [0] {
  19. }
  20. - Static methods [0] {
  21. }
  22. - Properties [1] {
  23. Property [ public string $name ]
  24. }
  25. - Methods [55] {
  26. Method [ <internal:Reflection> private method __clone ] {
  27. - Parameters [0] {
  28. }
  29. - Return [ void ]
  30. }
  31. Method [ <internal:Reflection, ctor> public method __construct ] {
  32. - Parameters [1] {
  33. Parameter #0 [ <required> object|string $objectOrClass ]
  34. }
  35. }
  36. Method [ <internal:Reflection, prototype Stringable> public method __toString ] {
  37. - Parameters [0] {
  38. }
  39. - Return [ string ]
  40. }
  41. Method [ <internal:Reflection> public method getName ] {
  42. - Parameters [0] {
  43. }
  44. - Tentative return [ string ]
  45. }
  46. Method [ <internal:Reflection> public method isInternal ] {
  47. - Parameters [0] {
  48. }
  49. - Tentative return [ bool ]
  50. }
  51. Method [ <internal:Reflection> public method isUserDefined ] {
  52. - Parameters [0] {
  53. }
  54. - Tentative return [ bool ]
  55. }
  56. Method [ <internal:Reflection> public method isAnonymous ] {
  57. - Parameters [0] {
  58. }
  59. - Tentative return [ bool ]
  60. }
  61. Method [ <internal:Reflection> public method isInstantiable ] {
  62. - Parameters [0] {
  63. }
  64. - Tentative return [ bool ]
  65. }
  66. Method [ <internal:Reflection> public method isCloneable ] {
  67. - Parameters [0] {
  68. }
  69. - Tentative return [ bool ]
  70. }
  71. Method [ <internal:Reflection> public method getFileName ] {
  72. - Parameters [0] {
  73. }
  74. - Tentative return [ string|false ]
  75. }
  76. Method [ <internal:Reflection> public method getStartLine ] {
  77. - Parameters [0] {
  78. }
  79. - Tentative return [ int|false ]
  80. }
  81. Method [ <internal:Reflection> public method getEndLine ] {
  82. - Parameters [0] {
  83. }
  84. - Tentative return [ int|false ]
  85. }
  86. Method [ <internal:Reflection> public method getDocComment ] {
  87. - Parameters [0] {
  88. }
  89. - Tentative return [ string|false ]
  90. }
  91. Method [ <internal:Reflection> public method getConstructor ] {
  92. - Parameters [0] {
  93. }
  94. - Tentative return [ ?ReflectionMethod ]
  95. }
  96. Method [ <internal:Reflection> public method hasMethod ] {
  97. - Parameters [1] {
  98. Parameter #0 [ <required> string $name ]
  99. }
  100. - Tentative return [ bool ]
  101. }
  102. Method [ <internal:Reflection> public method getMethod ] {
  103. - Parameters [1] {
  104. Parameter #0 [ <required> string $name ]
  105. }
  106. - Tentative return [ ReflectionMethod ]
  107. }
  108. Method [ <internal:Reflection> public method getMethods ] {
  109. - Parameters [1] {
  110. Parameter #0 [ <optional> ?int $filter = null ]
  111. }
  112. - Tentative return [ array ]
  113. }
  114. Method [ <internal:Reflection> public method hasProperty ] {
  115. - Parameters [1] {
  116. Parameter #0 [ <required> string $name ]
  117. }
  118. - Tentative return [ bool ]
  119. }
  120. Method [ <internal:Reflection> public method getProperty ] {
  121. - Parameters [1] {
  122. Parameter #0 [ <required> string $name ]
  123. }
  124. - Tentative return [ ReflectionProperty ]
  125. }
  126. Method [ <internal:Reflection> public method getProperties ] {
  127. - Parameters [1] {
  128. Parameter #0 [ <optional> ?int $filter = null ]
  129. }
  130. - Tentative return [ array ]
  131. }
  132. Method [ <internal:Reflection> public method hasConstant ] {
  133. - Parameters [1] {
  134. Parameter #0 [ <required> string $name ]
  135. }
  136. - Tentative return [ bool ]
  137. }
  138. Method [ <internal:Reflection> public method getConstants ] {
  139. - Parameters [1] {
  140. Parameter #0 [ <optional> ?int $filter = null ]
  141. }
  142. - Tentative return [ array ]
  143. }
  144. Method [ <internal:Reflection> public method getReflectionConstants ] {
  145. - Parameters [1] {
  146. Parameter #0 [ <optional> ?int $filter = null ]
  147. }
  148. - Tentative return [ array ]
  149. }
  150. Method [ <internal:Reflection> public method getConstant ] {
  151. - Parameters [1] {
  152. Parameter #0 [ <required> string $name ]
  153. }
  154. - Tentative return [ mixed ]
  155. }
  156. Method [ <internal:Reflection> public method getReflectionConstant ] {
  157. - Parameters [1] {
  158. Parameter #0 [ <required> string $name ]
  159. }
  160. - Tentative return [ ReflectionClassConstant|false ]
  161. }
  162. Method [ <internal:Reflection> public method getInterfaces ] {
  163. - Parameters [0] {
  164. }
  165. - Tentative return [ array ]
  166. }
  167. Method [ <internal:Reflection> public method getInterfaceNames ] {
  168. - Parameters [0] {
  169. }
  170. - Tentative return [ array ]
  171. }
  172. Method [ <internal:Reflection> public method isInterface ] {
  173. - Parameters [0] {
  174. }
  175. - Tentative return [ bool ]
  176. }
  177. Method [ <internal:Reflection> public method getTraits ] {
  178. - Parameters [0] {
  179. }
  180. - Tentative return [ array ]
  181. }
  182. Method [ <internal:Reflection> public method getTraitNames ] {
  183. - Parameters [0] {
  184. }
  185. - Tentative return [ array ]
  186. }
  187. Method [ <internal:Reflection> public method getTraitAliases ] {
  188. - Parameters [0] {
  189. }
  190. - Tentative return [ array ]
  191. }
  192. Method [ <internal:Reflection> public method isTrait ] {
  193. - Parameters [0] {
  194. }
  195. - Tentative return [ bool ]
  196. }
  197. Method [ <internal:Reflection> public method isEnum ] {
  198. - Parameters [0] {
  199. }
  200. - Return [ bool ]
  201. }
  202. Method [ <internal:Reflection> public method isAbstract ] {
  203. - Parameters [0] {
  204. }
  205. - Tentative return [ bool ]
  206. }
  207. Method [ <internal:Reflection> public method isFinal ] {
  208. - Parameters [0] {
  209. }
  210. - Tentative return [ bool ]
  211. }
  212. Method [ <internal:Reflection> public method getModifiers ] {
  213. - Parameters [0] {
  214. }
  215. - Tentative return [ int ]
  216. }
  217. Method [ <internal:Reflection> public method isInstance ] {
  218. - Parameters [1] {
  219. Parameter #0 [ <required> object $object ]
  220. }
  221. - Tentative return [ bool ]
  222. }
  223. Method [ <internal:Reflection> public method newInstance ] {
  224. - Parameters [1] {
  225. Parameter #0 [ <optional> mixed ...$args ]
  226. }
  227. - Tentative return [ object ]
  228. }
  229. Method [ <internal:Reflection> public method newInstanceWithoutConstructor ] {
  230. - Parameters [0] {
  231. }
  232. - Tentative return [ object ]
  233. }
  234. Method [ <internal:Reflection> public method newInstanceArgs ] {
  235. - Parameters [1] {
  236. Parameter #0 [ <optional> array $args = [] ]
  237. }
  238. - Tentative return [ ?object ]
  239. }
  240. Method [ <internal:Reflection> public method getParentClass ] {
  241. - Parameters [0] {
  242. }
  243. - Tentative return [ ReflectionClass|false ]
  244. }
  245. Method [ <internal:Reflection> public method isSubclassOf ] {
  246. - Parameters [1] {
  247. Parameter #0 [ <required> ReflectionClass|string $class ]
  248. }
  249. - Tentative return [ bool ]
  250. }
  251. Method [ <internal:Reflection> public method getStaticProperties ] {
  252. - Parameters [0] {
  253. }
  254. - Tentative return [ ?array ]
  255. }
  256. Method [ <internal:Reflection> public method getStaticPropertyValue ] {
  257. - Parameters [2] {
  258. Parameter #0 [ <required> string $name ]
  259. Parameter #1 [ <optional> mixed $default = <default> ]
  260. }
  261. - Tentative return [ mixed ]
  262. }
  263. Method [ <internal:Reflection> public method setStaticPropertyValue ] {
  264. - Parameters [2] {
  265. Parameter #0 [ <required> string $name ]
  266. Parameter #1 [ <required> mixed $value ]
  267. }
  268. - Tentative return [ void ]
  269. }
  270. Method [ <internal:Reflection> public method getDefaultProperties ] {
  271. - Parameters [0] {
  272. }
  273. - Tentative return [ array ]
  274. }
  275. Method [ <internal:Reflection> public method isIterable ] {
  276. - Parameters [0] {
  277. }
  278. - Tentative return [ bool ]
  279. }
  280. Method [ <internal:Reflection> public method isIterateable ] {
  281. - Parameters [0] {
  282. }
  283. - Tentative return [ bool ]
  284. }
  285. Method [ <internal:Reflection> public method implementsInterface ] {
  286. - Parameters [1] {
  287. Parameter #0 [ <required> ReflectionClass|string $interface ]
  288. }
  289. - Tentative return [ bool ]
  290. }
  291. Method [ <internal:Reflection> public method getExtension ] {
  292. - Parameters [0] {
  293. }
  294. - Tentative return [ ?ReflectionExtension ]
  295. }
  296. Method [ <internal:Reflection> public method getExtensionName ] {
  297. - Parameters [0] {
  298. }
  299. - Tentative return [ string|false ]
  300. }
  301. Method [ <internal:Reflection> public method inNamespace ] {
  302. - Parameters [0] {
  303. }
  304. - Tentative return [ bool ]
  305. }
  306. Method [ <internal:Reflection> public method getNamespaceName ] {
  307. - Parameters [0] {
  308. }
  309. - Tentative return [ string ]
  310. }
  311. Method [ <internal:Reflection> public method getShortName ] {
  312. - Parameters [0] {
  313. }
  314. - Tentative return [ string ]
  315. }
  316. Method [ <internal:Reflection> public method getAttributes ] {
  317. - Parameters [2] {
  318. Parameter #0 [ <optional> ?string $name = null ]
  319. Parameter #1 [ <optional> int $flags = 0 ]
  320. }
  321. - Return [ array ]
  322. }
  323. }
  324. }