044-PHP obtain information corresponding to a plurality of reflection type

? < PHP
 // get information corresponding to a plurality of reflection type 
class Demo {
     public     $ str_1 ;
     Private    $ str_2 ;
     protected  $ str_3 ; 

    public  function Test () { 

    } 
} 

class demo2 {
     public     $ RES_1 ;
     Private    $ Res_2 ;
     protected  $ RES_3 ; 

    Private  function Test () { 

    } 
} 

# get_declared_classes () to get the current names of all classes of 
the foreach ( get_declared_classes () AS class $ ) {
     $ MyClass = new new the ReflectionClass ( $ class );
     # isUserDefined detecting whether the user-defined class 
    IF ( $ MyClass -> isUserDefined ()) {
         echo '<pre>' ; 
        the Reflection :: Export ( $ MyClass ) ;
         echo '<pre />' ; 
    } 
}
 >?

 

Guess you like

Origin www.cnblogs.com/tianpan2019/p/10994154.html