ReflectionClass::isInterface

(PHP 5, PHP 7)
Checks if the class is an interface
public bool ReflectionClass::isInterface ( void )

Checks whether the class is an interface.

Returns:

Returns TRUE on success or FALSE on failure.

Examples:
Basic usage of ReflectionClass::isInterface()
<?php
interface SomeInterface {
    public function interfaceMethod();
}

$class = new ReflectionClass('SomeInterface');
var_dump($class->isInterface());
?>

The above example will output:

bool(true)
See also:

ReflectionClass::isInstance() -

doc_php
2016-02-24 16:13:24
Comments
Leave a Comment

Please login to continue.