You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feature twigphp#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 twigphp#3999Fixtwigphp#4146Fixtwigphp#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
-------
5d1a19a Swap BC layer for yield-ready and reclaim perf loss
0 commit comments