key_len is set with a HASH_KEY_IS_LONG key_type - it is only set with a HASH_KEY_IS_STRING:

```
    if (p) {
        if (p->nKeyLength) {
            if (duplicate) {
                *str_index = estrndup(p->arKey, p->nKeyLength - 1);
            } else {
                *str_index = (char*)p->arKey;
            }
            if (str_length) {
                *str_length = p->nKeyLength;
            }
            return HASH_KEY_IS_STRING;
        } else {
            *num_index = p->h;
            return HASH_KEY_IS_LONG;
        }
    }
```