"Fossies" - the Fresh Open Source Software Archive

Member "hhvm-HHVM-4.165.0/hphp/test/zend/good/ext/reflection/tests/001.php" (22 Jul 2022, 1627 Bytes) of package /linux/www/hhvm-HHVM-4.165.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 <?hh
    2 
    3 class ReflectionClassEx extends ReflectionClass
    4 {
    5     public $bla;
    6 
    7     function getMethodNames()
    8     {
    9         $res = varray[];
   10         foreach($this->getMethods() as $m)
   11         {
   12             $res[] = $m->class . '::' . $m->name;
   13         }
   14         return $res;
   15     }
   16 }
   17 <<__EntryPoint>> function main(): void {
   18 $r = new ReflectionClassEx('ReflectionClassEx');
   19 
   20 $exp = varray [
   21   'UMLClass::__clone',
   22   'UMLClass::export',
   23   'UMLClass::__construct',
   24   'UMLClass::__toString',
   25   'UMLClass::getName',
   26   'UMLClass::isInternal',
   27   'UMLClass::isUserDefined',
   28   'UMLClass::isInstantiable',
   29   'UMLClass::getFileName',
   30   'UMLClass::getStartLine',
   31   'UMLClass::getEndLine',
   32   'UMLClass::getDocComment',
   33   'UMLClass::getConstructor',
   34   'UMLClass::getMethod',
   35   'UMLClass::getMethods',
   36   'UMLClass::getProperty',
   37   'UMLClass::getProperties',
   38   'UMLClass::getConstants',
   39   'UMLClass::getConstant',
   40   'UMLClass::getInterfaces',
   41   'UMLClass::isInterface',
   42   'UMLClass::isAbstract',
   43   'UMLClass::isFinal',
   44   'UMLClass::getModifiers',
   45   'UMLClass::isInstance',
   46   'UMLClass::newInstance',
   47   'UMLClass::getParentClass',
   48   'UMLClass::isSubclassOf',
   49   'UMLClass::getStaticProperties',
   50   'UMLClass::getDefaultProperties',
   51   'UMLClass::isIterateable',
   52   'UMLClass::implementsInterface',
   53   'UMLClass::getExtension',
   54   'UMLClass::getExtensionName'];
   55 
   56 $miss = varray[];
   57 
   58 $res = $r->getMethodNames();
   59 
   60 foreach($exp as $m)
   61 {
   62     if (!in_array($m, $exp))
   63     {
   64         $miss[] = $m;
   65     }
   66 }
   67 
   68 var_dump($miss);
   69 
   70 $props = array_keys(get_class_vars('ReflectionClassEx'));
   71 sort(inout $props);
   72 var_dump($props);
   73 var_dump($r->name);
   74 echo "===DONE===\n";
   75 }