Prior to mongodb/mongo-php-driver#1259 for PHPC-1933, tests/cursor/cursor-iterator-003.phpt failed locally with a debug build of PHP 8.1:
Fatal error: MongoDB\Driver\Cursor::key(): Return value must be of type int, null returned in Unknown on line 0
I was curious as to why this wasn't caught by mongodb/mongo-php-driver#1258 for PHPC-1965, which re-added PHP 8.1 to GitHub CI. That test was not reported as a failure or skip in the CI task output.
Looking into this a bit further, it seems that the error is only reported for debug builds of PHP (see: zend_verify_internal_return_error).
We should see if it's possible to use debug PHP builds on GitHub CI. If that's not possible, we should at least confirm that debug builds are being used in Evergreen.