Reflection ReflectionClass::getDocComment
(PHP 5, PHP 7, PHP 8)
ReflectionClass::getDocComment — 문서 주석 가져오기
설명
public ReflectionClass::getDocComment(): string|false
클래스에서 문서 주석을 가져옵니다. 문서 주석은 /**로 시작합니다. 클래스 정의 위에 문서 주석이 여러 개 있는 경우 클래스에 가장 가까운 주석이 사용됩니다.
매개변수
이 함수에는 매개변수가 없습니다.
반환 값
문서 주석이 있는 경우 그렇지 않으면 false
입니다.
Examples
예제 #1 ReflectionClass::getDocComment() 예제
<?php
/**
* A test class
*
* @param foo bar
* @return baz
*/
class TestClass { }
$rc = new ReflectionClass('TestClass');
var_dump($rc->getDocComment());
?>
위의 예는 다음을 출력합니다.
string(55) "/** * A test class * * @param foo bar * @return baz */"
기타
- ReflectionClass::getName() - 클래스 이름 가져오기