The days of lovely care-to-the-wind typecasting are coming to close. Finding this devilish bug took us entirely too long.
PHP-8.2.1 was throwing errors seemingly uncaught (they were eventually seen amassing in / var / log / apache / DOMAIN-ssl-err.log ) due to mismatch between return types of the necessary interface methods in our 'implements \Iterator' class (which had worked fine for many years, until our leap up to 8.2.1) versus the interface methods required by PHP.
Particularly:
next()
=====
ours:
public function next() {...}
PHP-8.2.1's
public function next() : void {...}
valid()
======
ours:
public function valid() {...}
PHP-8.2.1's:
public function valid() : bool {...}
key()
====
ours:
public function key() {...}
PHP-8.2.1's:
public function key() : mixed {...}
rewind()
========
ours:
public function rewind() {...}
PHP-8.2.1's:
public function rewind() : void {...}
current()
=======
ours:
public function current() {...}
PHP-8.2.1's:
public function current() : mixed {...}
We added the missing / now all-important return types to our function/method declarations and everything instantly worked again.
This extreme stringency is not made clear enough, IMHO, in the Iterator manual page.