首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

ReflectionProperty::getDocComment

(PHP 5 >= 5.1.0, PHP 7)

ReflectionProperty :: getDocComment - 获取属性文档评论

描述

代码语言:javascript
复制
public string ReflectionProperty::getDocComment ( void )

获取属性的文档注释。

参数

该功能没有参数。

返回值

属性文档评论。

例子

示例#1 ReflectionProperty :: getDocComment()示例

代码语言:javascript
复制
<?php
class?Str
{
????/**
?????*?@var?int??The?length?of?the?string
?????*/
????public?$length?=?5;
}

$prop?=?new?ReflectionProperty('Str',?'length');

var_dump($prop->getDocComment());

?>

上面的例子会输出类似于:

代码语言:javascript
复制
string(53) "/**
     * @var int  The length of the string
     */"

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com