interface_exists — 인터페이스가 정의되었는지 확인 정보
PHP interface_exists — 인터페이스가 정의되었는지 확인본문
interface_exists — 인터페이스가 정의되었는지 확인
설명 :
bool interface_exists ( string $interface_name [, bool $autoload = true ] )
주어진 인터페이스가 정의되었는지 확인합니다.
인수 :
interface_name
인터페이스명
autoload
__autoload 호출 여부, 기본값은 꺼짐
반환값 :
주어진 interface_name이 정의되었으면 TRUE, 아니면 FALSE를 반환합니다.
예제 :
Example #1 interface_exists() 예제
<?php
// 사용하기 전에 인터페이스가 존재하는지 확인
if (interface_exists('MyInterface')) {
class MyClass implements MyInterface
{
// 메쏘드
}
}
?>
추천
1
1
댓글 0개