twigphp/Twig — pull request #1583 by THofman (2014-12-23 10:50:40+00:00)
Title: The results of is_dir() are cached

If a production server uses statcache, the results of the first and second call of is_dir() is always the same.
So before calling is_dir() for the second time, use clearstatcache() to clear the results of the first call of is_dir().