Menu
Samaritan's Purse

IS_A

Checks if the object is of this class or has this class as one of its parents

SYNTAX

is_a ( mixed $object , string $class_name [, bool $allow_string = FALSE ] ) : bool

PARAMETERS

object

A class name or an object instance.

class_name

The class name

allow_string

If this parameter set to FALSE, string class name as object is not allowed. This also prevents from calling autoloader if the class doesn't exist.

RETURN

Returns TRUE if the object is of this class or has this class as one of its parents, FALSE otherwise.

EXAMPLES

OBJECT CLASS_NAME

true

ALLOW_STRING | FALSE

false

ALLOW_STRING | TRUE

true

NAMESPACE

true

INSTANCEOF

true

PHP