> If get_class() is called with anything other than an object, an E_WARNING level error is raised.

you should check if `$obejct` is actually object