pub fn valid(&mut self) -> bool {
        if let Some(valid) = unsafe { (*self.funcs).valid } {
            let valid = unsafe { valid(&mut *self) == ZEND_RESULT_CODE_SUCCESS };

            if ExecutorGlobals::has_exception() {
                return false;
            }

            valid
        } else {
            true
        }
    }
Check if the current position of the iterator is valid.

As an example this will call the user defined valid method of the
`\Iterator` interface. see <https://www.php.net/manual/en/iterator.valid.php>
src/types/iterator.rs