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

Deprecation warnings in PHP 8.1 #58

Open
davidmz opened this issue Sep 19, 2022 · 3 comments
Open

Deprecation warnings in PHP 8.1 #58

davidmz opened this issue Sep 19, 2022 · 3 comments

Comments

@davidmz
Copy link
Contributor

davidmz commented Sep 19, 2022

PHP 8.1 requires the offsetGet function to be compatible with the ArrayAccess declaration, i.e. to have a mixed return type. Without this, the Chain library produces deprecation notices like this:

PHP Deprecated:  Return type of Cocur\Chain\AbstractChain::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in .../vendor/cocur/chain/src/AbstractChain.php on line 46

Mixed type is only available in PHP 8, Chain supports 7.2, so the only way to meet the new requirements is to add the #[\ReturnTypeWillChange] attribute.

@R0Wi
Copy link

R0Wi commented Jul 9, 2023

I'm facing the same issue. Any news here, please?

@mcasto
Copy link

mcasto commented Aug 1, 2023

Same

@antrio
Copy link

antrio commented Jan 11, 2024

any news about that? you should at least point out this does not support php version > 8

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

No branches or pull requests

4 participants