// avoid using the same PHP class name for different cases
$p = new \ReflectionProperty($twig, 'templateClassPrefix'); $p->setAccessible(true); $p->setValue($twig, '__TwigTemplate_'.hash(\PHP_VERSION_ID < 80100 ? 'sha256' : 'xxh128', uniqid(mt_rand(), true), false).'_');