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()
1
2
3
4
5
6
7
8
<?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
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.