mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-13 10:56:38 +00:00
0a0febc32bbb7739df790211dcbe806de8d505a8
Commits
-------
7b8d476 optimized twig_escape_filter
Discussion
----------
Optimized twig_escape_filter
This optimizes the part of twig_escape_filter that checks if the charset is supported by htmlspecialchars.
This uses a static variable to avoid initializing the charsets array each time the function is called; and does a hash lookup instead of array search (saves a function call too).
The optimized version takes 66% less time that the original version on html escaping :) (no difference on js escaping).
…
…
…
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.
Description
Languages
PHP
99.9%