Files
Twig/tests/Fixtures/macros/duplicate_definition.legacy.test
2026-08-27 13:32:19 +02:00

14 lines
483 B
Plaintext

--TEST--
Defining a macro more than once is deprecated
--DEPRECATION--
Since twig/twig 3.29: Defining the macro "greet" more than once in "index.twig" is deprecated and will throw a SyntaxError in Twig 4.0 (previous definition at line 3, new definition at line 4). The last definition is used in Twig 3.
--TEMPLATE--
{% import _self as macros %}
{% macro greet() %}first{% endmacro %}
{% macro greet() %}second{% endmacro %}
{{ macros.greet() }}
--DATA--
return []
--EXPECT--
second