Fixes Twig lexerOptions throwing exception (#3877) and adds test for lexerOptions
Merge pull request #3878 from dapatrese/3877-twig-lexer-options-exception

Fixes Twig lexerOptions throwing exception (#3877)