反射類ReflectionClass,其中包含的方法可以通過下面的方法獲取:示例如下。
<?php
$class=new ReflectionClass("ReflectionClass");
$methods=$class->getMethods();
foreach($methods as $method)
echo $method->getName()."<br>";
?>
運(yùn)行結(jié)果如下:
__clone
export
__construct
__toString
getName
isInternal
isUserDefined
isInstantiable
getFileName
getStartLine
getEndLine
getDocComment
getConstructor
hasMethod
getMethod
getMethods
hasProperty
getProperty
getProperties
hasConstant
getConstants
getConstant
getInterfaces
getInterfaceNames
isInterface
isAbstract
isFinal
getModifiers
isInstance
newInstance
newInstanceArgs
getParentClass
isSubclassOf
getStaticProperties
getStaticPropertyValue
setStaticPropertyValue
getDefaultProperties
isIterateable
implementsInterface
getExtension
getExtensionName
posted on 2009-06-28 15:00
期待明天 閱讀(632)
評(píng)論(0) 編輯 收藏 所屬分類:
PHP