/hphp/test/slow/reflection_classes/class_ordering.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
- <?hh
- 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";
- }
- }
- <<__EntryPoint>>
- function main_class_ordering() {
- error_reporting(-1);
- reflect();
- }