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
                

기타