is_a() To check if class instantiated

is_a()

Description from php.net

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

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

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

Usage

[php]
if (!is_a($CartClass, ‘Cart’))
$CartClass = new Cart;
[/php]