|
is_subclass_ofChecks if the object has this class as one of its parents Description
bool is_subclass_of
( mixed
$object
, string $class_name
[, bool $allow_string = TRUE
] )
Checks if the given Parameters
Return Values
This function returns Changelog
Examples
Example #1 is_subclass_of example
<?php 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
<?php The above example will output: Yes, $my_object is a subclass of MyInterface Yes, MyClass is a subclass of MyInterface Notes
See Also
|