Skip to content

[TwigBundle] fix preload unlinked class BinaryOperatorExpressionParser #61153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

sp-aleix-fabra
Copy link

@sp-aleix-fabra sp-aleix-fabra commented Jul 18, 2025

Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix twigphp/Twig#4647
License MIT

Problem

Upgrading Twig from v3.20.0 to v3.21.1 causes PHP preload errors on startup:

PHP Warning:  Can't preload unlinked
class Twig\ExpressionParser\Infix\BinaryOperatorExpressionParser@anonymous: 
Unknown parent Twig\ExpressionParser\Infix\BinaryOperatorExpressionParser
in /var/www/html/vendor/twig/twig/src/ExtensionSet.php on line 528

Details

Branch: 5.4

  • Twig v3.20.0 works without error ✅
  • Twig v3.21.1 produces the error above ❌

Solution

Applying same changes that were made in #60859

@carsonbot
Copy link

Hey!

To help keep things organized, we don't allow "Draft" pull requests. Could you please click the "ready for review" button or close this PR and open a new one when you are done?

Note that a pull request does not have to be "perfect" or "ready for merge" when you first open it. We just want it to be ready for a first review.

Cheers!

Carsonbot

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has a contribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (see https://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (see https://symfony.com/releases)
  • Features and deprecations must be submitted against the 7.4 branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@carsonbot
Copy link

Hey!

Oh no, it looks like you have made this PR towards a branch that is not maintained anymore. :/
Could you update the PR base branch to target one of these branches instead? 6.4, 7.2, 7.3, 7.4, 8.0.

Cheers!

Carsonbot

@sp-aleix-fabra
Copy link
Author

sp-aleix-fabra commented Jul 18, 2025

Hey!

Oh no, it looks like you have made this PR towards a branch that is not maintained anymore. :/ Could you update the PR base branch to target one of these branches instead? 6.4, 7.2, 7.3, 7.4, 8.0.

Cheers!

Carsonbot

This change is already done for 6.4 => See #60859

We're using Symfony 5.4 and when we updated the Twig library the problem arose.

Can it still be merged to 5.4?

@xabbuh
Copy link
Member

xabbuh commented Jul 18, 2025

Can it still be merged to 5.4?

No, Symfony 5.4 does not receive bugfixes anymore (see https://symfony.com/releases/5.4).

@xabbuh xabbuh closed this Jul 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy