|
is_subclass_ofChecks if the object has this class as one of its parents or implements it Description
bool is_subclass_of(mixed
$object_or_class , string $class , bool $allow_string = true )
Checks if the given Parameters
Return Values
This function returns Examples
Example #1 is_subclass_of example
The above example will output: yes, $WFC is a subclass of WidgetFactory no, $WF is not a subclass of WidgetFactory yes, WidgetFactory_Child is a subclass of WidgetFactory
Example #2 is_subclass_of using interface example
The above example will output: Yes, $my_object is a subclass of MyInterface Yes, MyClass is a subclass of MyInterface Notes
See Also
|