
ReflectionMethod::isPublic 메서드는 ReflectionMethod 객체의 public 접근 제어자를 반환합니다.
private 메서드의 경우 ReflectionMethod 객체를 통해 접근할 수 없지만, ReflectionMethod::isPublic 메서드는 private 메서드의 접근 제어자를 반환합니다.
이때 반환되는 값은 FALSE입니다.
예를 들어, private 메서드인 'private function privateMethod()'가 있을 때, ReflectionMethod::create('privateMethod')를 통해 생성된 ReflectionMethod 객체의 isPublic 메서드는 FALSE를 반환합니다.
이러한 동작은 PHP의 Reflection API가 private 메서드의 존재를 인식하지만, 실제로 접근할 수 없기 때문입니다.
따라서, ReflectionMethod::isPublic 메서드는 private 메서드의 경우 FALSE를 반환합니다.
2025-03-06 11:17