Issue Bug Closed

#109441Lazy proxy generation fails for readonly classes implementing ReactionInterface on PHP 8.2

Stefan Froemken 03/31/26, 13:28 updated 08/11/26, 08:46

Description

Hello,

after updating to the current TYPO3 version 14.2, the system fails during the autoload generation and the subsequent asset publishing process. The issue arises because the reactions system extension automatically marks all classes implementing TYPO3\CMS\Reactions\Reaction\ReactionInterface as lazy.

In typo3/sysext/reactions/Configuration/Services.php, the following configuration is used:

$containerBuilder
->registerForAutoconfiguration(ReactionInterface::class)
->setPublic(true)
->setLazy(true)
->addTag(‘reactions.reaction’);

When a custom extension implements this interface using a PHP readonly class on PHP 8.2, the Symfony Dependency Injection component fails. The ProxyHelper in Symfony cannot generate lazy proxies for readonly classes on PHP versions lower than 8.3.

This creates a conflict because TYPO3 14 supports PHP 8.2, but the mandatory lazy loading for reactions is incompatible with readonly service classes in this PHP version.

This issue relates to the architectural limitations discussed in Ticket #108349.

Steps to Reproduce

  • Use a TYPO3 environment running on PHP 8.2.
  • Create a custom reaction handler class marked as readonly that implements ReactionInterface.
  • Ensure the class is discovered by the service container.
  • Run composer update or composer dump-autoload.

Actual Result

The process terminates with a fatal error during proxy generation:
“Cannot generate lazy proxy with PHP < 8.3: class [ClassName] is readonly.”

Tested with my TYPO3 extension: changelog_mcp

Stefan

Reviews 2

History 69

  1. Benjamin Franzke commented <span data-processor="relativetime" data-value="2026-03-31T17:14:49+00:00" > 03/31/26, 17:14 </span>

    Hey Stefan,

    Please clarify, did this actually work in v14.1 with PHP 8.2?

    I see you added this code to you repository last week: https://github.com/froemken/changelog-mcp/commit/0c543ce4bd407bdec3b162c9085dc6cb3c938258
    Maybe you didn’t test again PHP 8.2 until now and this is not really a regression but never worked?

    I agree it is not ideal that `composer install` fails here (that could be a general topic to launch the asset publishing in a failsafe mode, but I don’t know the details), but the error you are facing itself would not allow to operate TYPO3 in PHP 8.2, because your code uses readonly which is simply not supported by Symfony DI in this case.

    This is something that needs to be tested by extensions, by running tests against 8.2.

  2. Stefan Froemken commented <span data-processor="relativetime" data-value="2026-04-01T15:31:53+00:00" > 04/01/26, 15:31 </span>

    Hi Benjamin,

    “Please clarify, did this actually work in v14.1 with PHP 8.2?“
    I have just created a fresh TYPO3 instance with 14.1 and PHP 8.2 and tried to install my extension. Error is the same:

    (1/2) Symfony\Component\DependencyInjection\Exception\InvalidArgumentException
    Cannot generate lazy proxy for service "StefanFroemken\ChangelogMcp\Reaction\ChangelogMcpReaction".

    “Maybe you didn’t test again PHP 8.2“
    This is correct. Locally I have configured my DDEV to run with PHP 8.4.
    I first detected this issue while installing this extension remote on my server which is running TYPO3 14.2 with PHP 8.2…and now 14.1 with PHP 8.2.

    “and this is not really a regression“
    don’t understand

    “but never worked“
    This extension is very very new. I just startet programming on it since 2 weeks. There is no 13 available version. It’s TYPO3 14 only.

    Official copy from PHP docs: “As of PHP 8.2.0, a class can be marked with the readonly modifier.”

    “but the error you are facing itself would not allow to operate TYPO3 in PHP 8.2, because your code uses readonly which is simply not supported by Symfony DI in this case.”

    It’s the TYPO3 reaction extension which marks ALL reaction classes as “lazy”. So, it’s up to the TYPO3 core to solve that.

    “This is something that needs to be tested by extensions, by running tests against 8.2.“
    I just have tested it against PHP 8.2 and it is not running

    Stefan

  3. Gerrit Code Review pushed patch set 1 for main to change 93862 status Needs Feedback Under Review <span data-processor="relativetime" data-value="2026-04-27T20:20:57+00:00" > 04/27/26, 20:20 </span>

  4. Stefan Froemken commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-05-02T15:45:08+00:00" > 05/02/26, 15:45 </span>

    Applied in changeset commit:9e031d4cbd8106c5de4ae6343d326ac4062dc181.