PageRenderTime 24ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/hphp/test/slow/reflection_classes/class_ordering.php

http://github.com/facebook/hiphop-php
PHP | 42 lines | 33 code | 9 blank | 0 comment | 0 complexity | 6334094543edab63ad30af3f3b7dcc86 MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
  1. <?hh
  2. interface X {
  3. const X = 'const from X';
  4. function fromX();
  5. }
  6. interface I {
  7. const I = 'const from I';
  8. function fromI();
  9. }
  10. interface J extends I {
  11. const J = 'const from J';
  12. function fromJ();
  13. }
  14. abstract class Abs implements J, X {
  15. const ABS = 'const from Abs';
  16. abstract function fromAbs();
  17. }
  18. function reflect() {
  19. $rc_abs = new ReflectionClass('Abs');
  20. echo 'interfaces:', 'hhvm differs slightly from PHP5 slightly here', "\n";
  21. print_r($rc_abs->getInterfaceNames());
  22. echo 'constants:', "\n";
  23. print_r($rc_abs->getConstants());
  24. echo 'methods:', "\n";
  25. foreach ($rc_abs->getMethods() as $meth) {
  26. echo $meth->getName(), "\n";
  27. }
  28. }
  29. <<__EntryPoint>>
  30. function main_class_ordering() {
  31. error_reporting(-1);
  32. reflect();
  33. }