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

Incompatibility with Iterator and ArrayAccess interfaces #453

Closed
fudgelabs opened this issue Apr 9, 2022 · 1 comment
Closed

Incompatibility with Iterator and ArrayAccess interfaces #453

fudgelabs opened this issue Apr 9, 2022 · 1 comment

Comments

@fudgelabs
Copy link

Using PHP version 8.1.0, it looks as though the Vector class is no longer compatible with the Iterator and ArrayAccess interfaces. I think the incompatibility is solely due to unspecified return types (see errors below -received when instantiating a Vector in a test).

I can add the return types myself, but thought maybe someone else may want to know.

Deprecated: Return type of MathPHP\LinearAlgebra\Vector::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/vagrant/matrixstiffness_v0.3/vendor/markrogoyski/math-php/src/LinearAlgebra/Vector.php on line 807

Deprecated: Return type of MathPHP\LinearAlgebra\Vector::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /.../vendor/markrogoyski/math-php/src/LinearAlgebra/Vector.php on line 812

Deprecated: Return type of MathPHP\LinearAlgebra\Vector::offsetGet($i) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /.../vendor/markrogoyski/math-php/src/LinearAlgebra/Vector.php on line 762

Deprecated: Return type of MathPHP\LinearAlgebra\Vector::offsetSet($i, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /.../vendor/markrogoyski/math-php/src/LinearAlgebra/Vector.php on line 772

Deprecated: Return type of MathPHP\LinearAlgebra\Vector::offsetUnset($i) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /.../vendor/markrogoyski/math-php/src/LinearAlgebra/Vector.php on line 781
@markrogoyski
Copy link
Owner

Hi @fudgelabs

Thank you for your interest in MathPHP and reporting this issue. This has been addressed in the latest release v2.6.0, as well as some other PHP 8.1 compatibility issues.

Thanks again for the feedback and helping to improve MathPHP.

Mark

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

2 participants