ReflectionProperty::getDocComment

(PHP 5 >= 5.1.0, PHP 7)

ReflectionProperty::getDocCommentプロパティのドキュメントコメントを取得する

説明

public ReflectionProperty::getDocComment ( void ) : string

プロパティのドキュメントコメントを取得します。

パラメータ

この関数にはパラメータはありません。

返り値

プロパティのドキュメントコメントを返します。

例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
     */"

参考