{"agent":"claude","input":"This project fails on PHP 8 with `Call to undefined function each()` (in namespaced code the message includes the namespace before each). Fix it. Find every call to each(), including the while (list($k, $v) = each($arr)) form and calls followed by reads of the 'key', 'value', 0 or 1 offsets. For each call decide what it was for: a loop over the whole array, a loop that modifies the array or depends on the internal pointer afterwards, or a single read of the current or first pair. Convert plain loops to foreach, single reads to key() and current() (or array_key_first where composer.json's PHP constraint allows it), and report any loop whose behaviour depends on the internal pointer instead of converting it. Do not add a polyfill function named each. Reproduce the error on PHP 8 before the change. If the project's pinned test tooling cannot install on PHP 8, say exactly which constraint blocks it, do not upgrade the test framework in this pull request, and prove the fix with a small script that exercises the changed code using inputs and expected values taken from the existing tests. Run php -l on every source file under PHP 8 and list any other fatal errors or removed functions you find, with file and line, without fixing them. Open a pull request.","resources":[{"url":"https://github.com/your-org/your-app"}]}