Closed elpiel closed 7 years ago
The intent of the assertion is to determine if there is an appropriate extends. If the class cannot be found (either because the class is already known, or via autoloading), then whilst it may be inappropriate, it does deny the fact that class A can extend class B and therefore A is a subclass of B. It just means no one has a clue what a B is, but A sure does extend from it!
Consider also that is_subclass_of() will use an autoloader if there is one present, class_exists() would seem redundant.
Is there a reason why the
subclassOf()
doesn't check if the passed$className
exists or not?I've just checked in PHP documentation, they also don't check that(tested with code) and btw it's not clear if PHP checks it or not in the documetation.