runkit7_method_remove
(PECL runkit7 >= Unknown)
runkit7_method_remove — 주어진 메소드를 동적으로 제거
설명
runkit7_method_remove(string $class_name
, string $method_name
): bool
참고: 이 함수는 현재 실행 중인(또는 연결된) 메서드를 조작하는 데 사용할 수 없습니다.
매개변수
class_name
- 메소드를 제거할 클래스
method_name
- 제거할 메소드의 이름
반환 값
성공하면 true
를, 실패하면 false
를 반환합니다.
Examples
예제 #1 runkit7_method_remove() 예제
<?php
class Example {
function foo() {
return "foo!\n";
}
function bar() {
return "bar!\n";
}
}
// Remove the 'foo' method
runkit7_method_remove(
'Example',
'foo'
);
echo implode(' ', get_class_methods('Example'));
?>
위의 예는 다음을 출력합니다.
bar
기타
- runkit7_method_add() - 주어진 클래스에 새로운 메소드를 동적으로 추가
- runkit7_method_copy() - 클래스에서 다른 클래스로 메소드 복사
- runkit7_method_redefine() - 주어진 메소드의 코드를 동적으로 변경
- runkit7_method_rename() - 주어진 메소드의 이름을 동적으로 변경
- runkit7_function_remove() - 함수 정의 제거