(PHP 5, PHP 7, PHP 8)
ReflectionClass::getDocComment — 獲取文檔注釋
從一個(gè)類(lèi)中獲取文檔注釋。
本函數還未編寫(xiě)文檔,僅有參數列表。
此函數沒(méi)有參數。
如果存在則返回文檔注釋?zhuān)駝t返回 false
。
示例 #1 ReflectionClass::getDocComment() 例子
<?php
/**
* A test class
*
* @param foo bar
* @return baz
*/
class TestClass { }
$rc = new ReflectionClass('TestClass');
var_dump($rc->getDocComment())
?>
以上例程會(huì )輸出:
string(55) "/** * A test class * * @param foo bar * @return baz */"