Fabien Potencier 80c15749f9 feature #4216 Swap BC layer for yield-ready and reclaim perf loss (nicolas-grekas)
This PR was merged into the 3.x branch.

Discussion
----------

Swap BC layer for yield-ready and reclaim perf loss

Follows #3999

Fix #4146
Fix #4103

When `use_yield` is set to false (the default), this PR reverts the implementation of the `render()` method to use a wrapping output buffer instead of hooking between each steps of generators. In this mode, the behavior of the yield method is not "pure": it triggers a mix of yield and echo. But this is fine for render and display methods.

When `use_yield` is set to `true`, we skip that wrapping output buffer. This makes twig compatible with fibers (and this also makes compilation fail if a non-YieldReady extension is found.)

That makes the name of the option not ideal, but BC rulez FTW.

Commits
-------

5d1a19a8 Swap BC layer for yield-ready and reclaim perf loss
2024-08-19 20:02:33 +02:00
2024-08-10 12:32:24 +02:00
2024-08-18 17:52:16 +02:00
2024-08-18 19:25:19 +02:00
2024-08-18 17:52:16 +02:00
2024-08-10 12:32:24 +02:00
2024-02-07 12:11:29 +01:00

Twig, the flexible, fast, and secure template language for PHP
==============================================================

Twig is a template language for PHP.

Twig uses a syntax similar to the Django and Jinja template languages which
inspired the Twig runtime environment.

Sponsors
--------

.. raw:: html

    <a href="https://docs.blackfire.io/introduction?utm_source=twig&utm_medium=github_readme&utm_campaign=logo">
        <img src="https://static.blackfire.io/assets/intemporals/logo/png/blackfire-io_secondary_horizontal_transparent.png?1" width="255px" alt="Blackfire.io">
    </a>

More Information
----------------

Read the `documentation`_ for more information.

.. _documentation: https://twig.symfony.com/documentation
Languages
PHP 99.9%