Render a small template

Purpose of this benchmark is to use a maximum of features of template engines.
Template contains duplicated code, to not use loops and represent a real template.

Call GET
Template ~ 9,600 lines, ~ 550 Ko Example
Use a layout Yes Example
Blocks 50 (create and fill) Example
Custom functions 100 (create and call) Example
Macros 100 (create and call) Example
Escape strings for HTML 500 (escape and echo) Example
Escape strings for Javascript 500 (escape and assign) Example
Variables assignation 100 Example
Echo raw strings 100 Example
Echo unknowns variables 100 Example
Echo object methods call 500 Example
Templates inclusions 50 Example
Response ~ 9,300 lines, ~ 530 Ko Example

PHP

#1 PHP 8.0 5.4 ms
39,166
#2 PHP 7.4 5 ms
38,444
#3 PHP 7.3 5.4 ms
37,542
#4 PHP 7.2 6.4 ms
33,335
#5 PHP 7.0 7.2 ms
28,498