Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# 3.28.0 (2026-XX-XX)

* Mark `Twig\Markup` as `@final`; it will be final in Twig 4.0
* Reduce memory usage and speed up the context restoration compiled at the end of `for` loops
* Allow calling a macro with a dynamic name via the dot operator (`macros.(name)(args)`)
* Report the column number in syntax errors and expose it via `Error::getTemplateColumn()`
Expand Down
6 changes: 6 additions & 0 deletions doc/deprecated.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ This document lists deprecated features in Twig 3.x. Deprecated features are
kept for backward compatibility and removed in the next major release (a
feature that was deprecated in Twig 3.x is removed in Twig 4.0).

Classes
-------

* The ``Twig\Markup`` class is considered final as of Twig 3.28 and will be
final in Twig 4.0. Use ``Twig\Markup`` directly instead of extending it.

Functions
---------

Expand Down
13 changes: 7 additions & 6 deletions src/Markup.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@
/**
* Marks a content as safe.
*
* Instances of this class (and any subclass) are trusted by the Twig
* sandbox: method calls and property accesses on a Markup instance bypass
* the SecurityPolicy method/property allowlists. This is by design: Markup
* Instances of this class (and existing subclasses) are trusted by the Twig
* sandbox: method calls and property accesses on a Markup instance bypass the
* SecurityPolicy method/property allowlists. This is by design: Markup
* represents content that has already been deemed safe to output.
*
* As a consequence, when extending this class, you are responsible for
* ensuring that every method and property exposed by your subclass is
* safe to call from a sandboxed template.
* This class is considered final as of Twig 3.28 and will be final in Twig
* 4.0.
*
* @final since Twig 3.28
*
* @author Fabien Potencier <fabien@symfony.com>
*/
Expand Down
Loading