When using the tensor PHP extension with PHP 8.1 we have these PHP warnings:
Deprecated: Return type of Tensor\Vector::offsetGet($index) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in Unknown on line 0
Deprecated: Return type of Tensor\Vector::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in Unknown on line 0
Deprecated: Return type of Tensor\Matrix::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in Unknown on line 0
a simple fix is to simply add this line right before these methods:
When using the tensor PHP extension with PHP 8.1 we have these PHP warnings:
a simple fix is to simply add this line right before these methods:
See https://www.php.net/manual/en/migration81.incompatible.php#migration81.incompatible.core.type-compatibility-internal