php 反射执行类方法,PHP 反射类及用法

class ReflectionClass implements Reflector {

/* 常量 */

const integer IS_IMPLICIT_ABSTRACT = 16 ;

const integer IS_EXPLICIT_ABSTRACT = 32 ;

const integer IS_FINAL = 64 ;

/* 属性 */

public $name ;

/* 方法 */

public __construct ( mixed $argument );

public static string export ( mixed $argument [, bool $return = false ] );

public mixed getConstant ( string $name );

public array getConstants ( void );

public ReflectionMethod getConstructor ( void );

public array getDefaultProperties ( void );

public string getDocComment ( void );

public int getEndLine ( void );

public ReflectionExtension getExtension ( void );

public string getExtensionName ( void );

public string getFileName ( void );

public array getInterfaceNames ( void );

public array getInterfaces ( void );

public ReflectionMethod getMethod ( string $name );

public array getMethods ([ int $filter ] );

public int getModifiers ( void );

public string getName ( void );

public string getNamespaceName ( void );

public object getParentClass ( void );

public array getProperties ([ int $filter ] );

public ReflectionProperty getProperty ( string $name );

public string getShortName ( void );

public int getStartLine ( void );

public array getStaticProperties ( void );

public mixed getStaticPropertyValue ( string $name [, mixed &$def_value ] );

public array getTraitAliases ( void );

public array getTraitNames ( void );

public array getTraits ( void );

public bool hasConstant ( string $name );

public bool hasMethod ( string $name );

public bool hasProperty ( string $name );

public bool implementsInterface ( string $interface );

public bool inNamespace ( void );

public bool isAbstract ( void );

public bool isCloneable ( void );

public bool isFinal ( void );

public bool isInstance ( object $object );

public bool isInstantiable ( void );

public bool isInterface ( void );

public bool isInternal ( void );

public bool isIterateable ( void );

public bool isSubclassOf ( string $class );

public bool isTrait ( void );

public bool isUserDefined ( void );

public object newInstance ( mixed $args [, mixed $... ] );

public object newInstanceArgs ([ array $args ] );

public object newInstanceWithoutConstructor ( void );

public void setStaticPropertyValue ( string $name , string $value );

public string __toString ( void );

}

?>

既可以使用一个包含类名的字符串(string)也可以使用一个类对象(object)来构造 ReflectionObject 类

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值