chain icon indicating copy to clipboard operation
chain copied to clipboard

Deprecation warnings in PHP 8.1

Open davidmz opened this issue 2 years ago • 3 comments

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.

davidmz avatar Sep 19 '22 20:09 davidmz

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

R0Wi avatar Jul 09 '23 15:07 R0Wi

Same

mcasto avatar Aug 01 '23 12:08 mcasto

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

antrio avatar Jan 11 '24 11:01 antrio