Thursday, February 3, 2022

Code update from PHP 7.4 to PHP 8.1 - Worksheet/Iterator.php



A PHP Error was encountered

Severity: 8192

Message: Return type of PhpOffice\PhpSpreadsheet\Worksheet\Iterator::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

Filename: Worksheet/Iterator.php

add  #[\ReturnTypeWillChange]

Line Number: 53,81

   #[\ReturnTypeWillChange]:

    public function key()
    {
        return $this->position;
    }

If you can not display EXCEL properly add

            ini_set('display_errors',0);

to suppress warning messages.

No comments:

Post a Comment