Skip to content
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

Add #[\ReturnTypeWillChange] for PHP 8.1 #20

Merged
merged 1 commit into from
Dec 1, 2022
Merged

Add #[\ReturnTypeWillChange] for PHP 8.1 #20

merged 1 commit into from
Dec 1, 2022

Conversation

luigifab
Copy link
Contributor

This PR fix with PHP 8.1/8.2:

Return type of Adamlc\AddressFormat\Format::offsetExists($offset) should either be compatible
 with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute
 should be used to temporarily suppress the notice

@adamlc
Copy link
Owner

adamlc commented Nov 25, 2022

Having not worked with PHP for some time, will this break on older versions?

@luigifab
Copy link
Contributor Author

luigifab commented Dec 1, 2022

No, it's a comment, so it doesn't break anything... except if someone create a class named ReturnTypeWillChange. The RFC page only mention PHP 7. I checked with PHP 5.0..8.2: simple example.

@adamlc
Copy link
Owner

adamlc commented Dec 1, 2022

Fantastic appreciate the testing :)

@adamlc adamlc merged commit 4427f9c into adamlc:master Dec 1, 2022
@luigifab luigifab deleted the php8 branch December 1, 2022 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants