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

Language PHP Lines 39
MD5 Hash 85f0b7a51a82c84359ea64c92fef0126 Estimated Cost $680 (why?)
Repository git://github.com/facebook/hiphop-php.git View Raw File View Project SPDX
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?hh


error_reporting(-1);

interface X {
  const X = 'const from X';
  function fromX();
}

interface I {
  const I = 'const from I';
  function fromI();
}

interface J extends I {
  const J = 'const from J';
  function fromJ();
}

abstract class Abs implements J, X {
  const ABS = 'const from Abs';
  abstract function fromAbs();
}

function reflect() {
  $rc_abs = new ReflectionClass('Abs');
  echo 'interfaces:', 'hhvm differs slightly from PHP5 slightly here', "\n";
  print_r($rc_abs->getInterfaceNames());
  echo 'constants:', "\n";
  print_r($rc_abs->getConstants());
  echo 'methods:', "\n";
  foreach ($rc_abs->getMethods() as $meth) {
    echo $meth->getName(), "\n";
  }

}
reflect();
Back to Top