`
rorely
  • 浏览: 113194 次
  • 性别: Icon_minigender_2
  • 来自: 北京
最近访客 更多访客>>
社区版块
存档分类
最新评论

php 反射类

    博客分类:
  • PHP
PHP 
阅读更多
反射类ReflectionClass,其中包含的方法可以通过下面的方法获取:示例如下。

<?php
    $class=new ReflectionClass("ReflectionClass");
    $methods=$class->getMethods();
    foreach($methods as $method)
        echo $method->getName()."<br>"; 
?>

运行结果如下:
__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


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics