Php 1093 refactor cursor logic

Does this need a sanity check to ensure `cursor->ns` is at least 5? Otherwise we might inadvertently read data before the string pointer.