annotations: CachedReader fails if Reflection class is eval'd code

If the ReflectionClass is eva’d code, then it crashes when checking when the cache is fresh. It tries to CachedReader::getLastModification of the eval’d code and results in:

Warning:` filemtime(): stat failed for /app/src/MyCode/EntityGenerator.php(36) : eval()'d code

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Comments: 17 (5 by maintainers)

Commits related to this issue

Most upvoted comments

I also started hitting this problem today for some yet unknown reason.

What causes ReflectionClass to say the filename is /.../.../vendor/friendsofphp/proxy-manager-lts/src/ProxyManager/GeneratorStrategy/EvaluatingGeneratorStrategy.php(54) : eval()'d code and why does CachedReader::getLastModification() insist on calling filemtime on such a non-path?

/summon @Ocramius

Would this be a performance problem?

Yes, but since we can’t determine the age of the file, then all caching should be skipped.