Skip to content


DCOM-47: When using different class loaders #647

doctrinebot opened this Issue · 6 comments

2 participants


Jira issue originally created by user gediminasm:

ClassLoader::classExists($class); will fail if different class loader is used which does not return any boolean value. This includes Symfony2 UniversalClassLoader

I have never used this function before because native PHP method class_exits($class, true) first will try to autoload. But if the class does not exist
and you are using Doctrine\Common::ClassLoader and you call class_exists($class) it will trigger fatal error. This behavior makes it impossible to make code compatible
with different class loading mechanisms for Doctrine2


Comment created by stof:

This is known and documented in the code:


Comment created by @guilhermeblanco:

Since Annotations package changed a lot since the bug was opened and today, I'm closing the ticket as "Cannot reproduce".

Please reopen it if the issue is still valid with a testcase.



Issue was closed with resolution "Cannot Reproduce"


Comment created by @beberlei:

This issue is referenced in Github Pull-Request GH-88


Comment created by juzna:

Still a problem! Especially since this is used by ORM (doctrine/doctrine2@3aea203)

Class loader doesn't have to return bool (and usually DOES NOT), so even though it has loaded the class, classExists will return false. Please pull this #88


Comment created by @beberlei:

Related Pull Request was closed: #88

@doctrinebot doctrinebot added the Bug label
@doctrinebot doctrinebot added this to the 2.1.2 milestone
@doctrinebot doctrinebot closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.