Fabien Potencier 118a3a741e bug #4728 Fix opcache preload warning for unlinked anonymous class (OndraM)
This PR was merged into the 3.x branch.

Discussion
----------

Fix opcache preload warning for unlinked anonymous class

This fixes PHP opcache preload warning, caused by https://github.com/php/php-src/issues/10131 .  The warning is now produced when the preload is initiated.

> Can't preload unlinked class Twig\ExpressionParser\Infix\BinaryOperatorExpressionParser@anonymous: Unknown parent Twig\ExpressionParser\Infix\BinaryOperatorExpressionParser

This started with Twig 3.21, when the anonymous class started to be used in ExtensionSet.

This is a similar woraround as is already used in a TwigBridge, as suggested by `@nicolas`-grekas here https://github.com/symfony/symfony/pull/38533
Also similar fix is in API platform: https://github.com/api-platform/core/pull/3827

Commits
-------

86997d1bef Fix opcache preload warning for unlinked anonymous class
2026-01-05 21:36:53 +01:00
2025-07-29 09:57:34 +02:00
2025-07-29 10:07:07 +02:00
2025-11-26 20:33:56 +01:00
2025-07-29 10:07:07 +02:00
2025-12-14 12:29:52 +01:00
2025-01-31 21:45:36 +01:00
2024-11-20 20:05:33 +01:00
2025-12-05 11:47:00 +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%