I don't understand what you are saying.

In the MongoCommandCursor ctor you call mongo_command_cursor_init().
It is not executed or anything, just bootstrapped.

The command itself is actually executed in ->rewind(), which calls php_mongo_runcommand() which doesn't need the ns.
After executing the command, you wind up with a result document looking like
```
{cursor: { id: n, ns: "dbname.collectionname"}, ok: 1}
```
And you read out the cursor.id and set that to your cmd_cursor->cursor_id

Why exactly cannot read out cursor.ns and set that to your cmd_cursor->ns there?

I cannot see where this cmd_cursor is used anywhere in between which would cause you needing this at all