ReflectionProperty::getDocComment
(PHP 5 >= 5.1.0, PHP 7)
ReflectionProperty :: getDocComment - 获取属性文档评论
描述
public string ReflectionProperty::getDocComment ( void )
获取属性的文档注释。
参数
该功能没有参数。
返回值
属性文档评论。
例子
示例#1 ReflectionProperty :: getDocComment()示例
<?php
class?Str
{
????/**
?????*?@var?int??The?length?of?the?string
?????*/
????public?$length?=?5;
}
$prop?=?new?ReflectionProperty('Str',?'length');
var_dump($prop->getDocComment());
?>
上面的例子会输出类似于:
string(53) "/**
* @var int The length of the string
*/"
本文档系腾讯云开发者社区成员共同维护,如有问题请联系 cloudcommunity@tencent.com