That would be stupid design. Thankfully you are wrong:

      MAKE_STD_ZVAL(retval);
      MONGO_METHOD(MongoCursor, getNext, retval, cursor);
      if (EG(exception)) {
          zval_ptr_dtor(&retval);
          zval_ptr_dtor(&cursor);
          return NULL;
      }