Reflection ReflectionMethod::__toString
(PHP 5, PHP 7, PHP 8)
ReflectionMethod::__toString — Reflection 메서드 개체의 문자열 표현을 반환합니다.
설명
public ReflectionMethod::__toString(): string
Reflection 메서드 개체의 문자열 표현을 반환합니다.
매개변수
이 함수에는 매개변수가 없습니다.
반환 값
이 ReflectionMethod 인스턴스의 문자열 표현입니다.
Examples
예제 #1 ReflectionMethod::__toString() 예제
<?php
class HelloWorld {
public function sayHelloTo($name) {
return 'Hello ' . $name;
}
}
$reflectionMethod = new ReflectionMethod(new HelloWorld(), 'sayHelloTo');
echo $reflectionMethod;
?>
위의 예는 다음을 출력합니다.
Method [ <user> public method sayHelloTo ] { @@ /var/www/examples/reflection.php 16 - 18 - Parameters [1] { Parameter #0 [ <required> $name ] } }
기타
- ReflectionMethod::export() - Reflection 메서드 내보내기
- __toString()