← All docs
is_subclass_of()
Checks if the object has a given class as one of its parents or implements it.
is_subclass_of()
function is_subclass_of(mixed $object_or_class, string $class, bool $allow_string = true): bool
Checks if the object has a given class as one of its parents or implements it.
Parameters:
$object_or_class(mixed)$class(string)$allow_string(bool), defaulttrue, optional
Returns: bool
Availability
- Compiled (AOT): supported by the Elephc code generator.
eval()(magician interpreter): supported — declarative interpreter builtin (crates/elephc-magician/src/interpreter/builtins/symbols/is_subclass_of.rs).
No examples yet — check examples/ and showcases/ for usage patterns.
Internals
For how is_subclass_of is implemented in the compiler, see the internals page.