mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-14 19:36:43 +00:00
de909d49587dbb075eb7c3cf13cdd038eff94a9e
This PR was merged into the 1.x branch.
Discussion
----------
use str_replace instead of strtr to escape the source in the template
strtr is really slow when used this way.
Benchmark https://3v4l.org/PXWDg/perf#tabs vs https://3v4l.org/iuq1Z/perf#tabs
strtr is only slightly faster when used with a byte-by-byte replacement as done in https://github.com/twigphp/Twig/blob/1.x/lib/Twig/Lexer.php#L263
Commits
-------
19ef9a3 use str_replace instead of strtr to escape the source in the template
Twig, the flexible, fast, and secure template language for PHP ============================================================== Twig is a template language for PHP, released under the new BSD license (code and documentation). Twig uses a syntax similar to the Django and Jinja template languages which inspired the Twig runtime environment. More Information ---------------- Read the `documentation`_ for more information. .. _documentation: http://twig.sensiolabs.org/documentation
Description
Languages
PHP
99.9%