Skip to content

[BUG] 3.2.1+ requires PHP 8.1 but declares TYPO3 v11.5 support and no php constraint #775

Description

@contemas-tschmidt

Summary

Since 3.2.1 the extension contains PHP 8.1 syntax, but it still declares support for TYPO3 v11.5 and does not declare a php requirement at all. On a TYPO3 11.5 installation running PHP 7.4 or 8.0, Composer happily installs 3.2.3 and the site dies with a parse error during bootstrap.

The code

Classes/Domain/Core/RecordWithRenderedGrid.php (added in 3.2.1) uses constructor property promotion together with readonly:

public function __construct(
    protected readonly Record $coreRecord,
    protected readonly ?string $renderedGrid
) {
}

Promotion requires PHP 8.0, readonly requires PHP 8.1.

Why Composer does not prevent it

composer.json of 3.2.3:

"require": {
    "typo3/cms-backend": "^11.5 || ^12.4 || ^13.4 || ^14.0"
}

There is no php entry, so a project that pins its platform to PHP 7.4 (config.platform.php) gets no conflict — the constraint simply is not there. ext_emconf.php points the same way:

'depends' => ['typo3' => '11.5.0-14.99.99'],

TYPO3 11.5 supports PHP 7.4 through 8.2, so "TYPO3 11.5 compatible" and "needs PHP 8.1" cannot both be true.

Steps to reproduce

  1. TYPO3 11.5 project on PHP 7.4, "b13/container": "^3"
  2. composer update b13/container → resolves to 3.2.3
  3. Any request:
Uncaught TYPO3 Exception syntax error, unexpected 'protected' (T_PROTECTED), expecting variable
thrown in file .../typo3conf/ext/container/Classes/Domain/Core/RecordWithRenderedGrid.php in line 26

Expected

Either add "php": ">=8.1" to composer.json (and the matching PHP note to the docs), or drop ^11.5 from typo3/cms-backend and narrow ext_emconf.php accordingly — whichever matches the intended support matrix. Right now Composer has no way to keep a PHP 7.4 project off the broken version.

Affected versions

  • 3.2.0 — fine, no PHP 8 syntax
  • 3.2.1, 3.2.2, 3.2.3 — affected

Workaround for anyone hitting this: constrain to ^3 <3.2.1.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions