PHP Function Comments

后端 未结 4 1543
鱼传尺愫
鱼传尺愫 2021-01-29 20:52

Just a quick question: I\'ve seen that some PHP functions are commented at the top, using a format that is unknown to me:

/**
 *
 * Convert an object to an array         


        
4条回答
  •  天涯浪人
    2021-01-29 21:24

    You can get the comments of a particular method by using the ReflectionMethod class and calling ->getDocComment().

    http://www.php.net/manual/en/reflectionclass.getdoccomment.php

提交回复
热议问题