Skip to content

[Meta] PHP 8.2 Support #44282

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
29 tasks done
derrabus opened this issue Nov 25, 2021 · 6 comments
Closed
29 tasks done

[Meta] PHP 8.2 Support #44282

derrabus opened this issue Nov 25, 2021 · 6 comments
Assignees
Labels
Help wanted Issues and PRs which are looking for volunteers to complete them. Keep open Status: Needs Review

Comments

@derrabus
Copy link
Member

derrabus commented Nov 25, 2021

Symfony version(s) affected

(4.4), 5.3, 5.4, 6.0, 6.1, 6.2

Description

In November 2022, PHP 8.2 will be released and we should be prepared. In this PR, I'd like to track the efforts necessary to make all actively maintained branches ready for that release.

Ready means: if an application uses features of PHP 8.2, Symfony must not blow up.

We do already have a GitHub action that tests all branches with PHP 8.2. This action will constantly monitor Symfony's compatibility with the current state of PHP 8.2.

I will update this issue as we progress.

How to Contribute

If you want to join the effort, please start with the components and bridges. Fixing those will also fix many broken bundle tests. Reminder: We treat compatibility issues as bugs. As always, please fix bugs on the lowest maintained branch that suffers from the bug.

Progress

Components

Bridges

Bundles

@derrabus derrabus added the Bug label Nov 25, 2021
@derrabus derrabus self-assigned this Nov 25, 2021
@derrabus derrabus pinned this issue Nov 25, 2021
@derrabus derrabus added Help wanted Issues and PRs which are looking for volunteers to complete them. Keep open labels Nov 25, 2021
@stof
Copy link
Member

stof commented Nov 26, 2021

To me, this is too early to mark component as compatible in the check list. PHP itself has not done the changes for PHP 8.2, so what your checkbox means for now is compatibility with PHP 8.1 plus a few commits, not with PHP 8.2.

@derrabus
Copy link
Member Author

We can always un-check components if a new change is introduced to PHP that breaks a component. We did so on #41552 all the time.

But we can turn all those checkboxes into bullet points if that makes the list less confusing.

@derrabus
Copy link
Member Author

Here you go, no more component checkboxes.

@nicolas-grekas
Copy link
Member

Fixed by #45532

nicolas-grekas added a commit that referenced this issue Mar 2, 2022
This PR was merged into the 4.4 branch.

Discussion
----------

Fix deprecations on PHP 8.2

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | On the road to #44282
| License       | MIT
| Doc PR        | -

Commits
-------

ca56620 Fix deprecations on PHP 8.2
@nicolas-grekas nicolas-grekas unpinned this issue Mar 17, 2022
@wouterj
Copy link
Member

wouterj commented Apr 25, 2022

Shouldn't we always keep this meta task open, until PHP 8.2 is released?

@wouterj wouterj reopened this Apr 25, 2022
@wouterj wouterj pinned this issue Apr 25, 2022
@stof stof removed the Bug label Apr 25, 2022
derrabus added a commit that referenced this issue Jul 18, 2022
…sh ReflectionExtractor (derrabus)

This PR was merged into the 4.4 branch.

Discussion
----------

[PropertyInfo] Make sure nested composite types do not crash ReflectionExtractor

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Part of #44282
| License       | MIT
| Doc PR        | N/A

A composite type like `(\Traversable&\Countable)|null` which is allowed in PHP 8.2 currently causes a fatal error in `ReflectionExtractor` because of a call to an undefined function. This PR fixes it by making `ReflectionExtractor` report that it could not extract any types.

Implementing full support for composite types to the extent that PHP 8.2 supports them would not be too difficult, but it would probably not pass as a bugfix. Once this is merged up, I'll prepare a PR for the 6.2 branch implementing full support.

Commits
-------

f146e72 Make sure nested composite types do not crash ReflectionExtractor
xabbuh added a commit that referenced this issue Jul 19, 2022
… syntax (derrabus)

This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] Fix tests that use deprecated callable syntax

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Part of #44282
| License       | MIT
| Doc PR        | N/A

FrameworkBundle's tests currently fail because they use a deprecated way to referencing a callable: `[Foo::class, 'parent::bar']`. This PR moves this one fixture into a separate test with ``@group` legacy`.

Commits
-------

e95bd95 Fix tests that use deprecated callable syntax
fabpot added a commit that referenced this issue Jul 19, 2022
…utowire composite types (derrabus)

This PR was merged into the 4.4 branch.

Discussion
----------

[DependencyInjection] Fail gracefully when attempting to autowire composite types

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Part of #44282
| License       | MIT
| Doc PR        | N/A

Symfony 4.4 does not support autowiring union types. Unfortunately, we run into a fatal error when autowiring is attempted for a parameter with an intersection type nested into a union (`(A&B)|C`). Ironically, the error occurs while we try to generate a nice exception message.

This PR fixes this, so the developer gets a nice exception message about the parameter that cannot be autowired.

For nullable unions however, `null` is injected. This already was the case for `A|null` and it works out of the box for `(A&B)|null`. I've added a test case that covers this case.

Commits
-------

2543091 Fail gracefully when attempting to autowire composite types
fabpot added a commit that referenced this issue Jul 19, 2022
… union types (derrabus)

This PR was merged into the 4.4 branch.

Discussion
----------

[VarDumper] Add a test case for nesting intersection and union types

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Part of #44282
| License       | MIT
| Doc PR        | N/A

I've added a test case to verify that VarDumper can handler an intersection type inside a union type.

Commits
-------

cdd5c5b [VarDumper] Add a test case for nesting intersection and union types
@nicolas-grekas
Copy link
Member

I'm closing here because keeping it open is not needed: 8.2 is frozen now so the target is known and achieved. We have a CI job that runs 8.2 and this proved useful to report/fix issues upstream.

@nicolas-grekas nicolas-grekas unpinned this issue Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help wanted Issues and PRs which are looking for volunteers to complete them. Keep open Status: Needs Review
Projects
None yet
Development

No branches or pull requests

5 participants