Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please add zend_symtable_str_add function #15595

Closed
matyhtf opened this issue Aug 27, 2024 · 2 comments
Closed

Please add zend_symtable_str_add function #15595

matyhtf opened this issue Aug 27, 2024 · 2 comments

Comments

@matyhtf
Copy link
Contributor

matyhtf commented Aug 27, 2024

Description

The absence of this API requires a self-implemented solution, which should be provided by Zend_API.h.

static zend_always_inline zval *zend_symtable_str_add(HashTable *ht, const char *str, size_t len, zval *pData) {
    zend_ulong idx;

    if (ZEND_HANDLE_NUMERIC_STR(str, len, idx)) {
        return zend_hash_index_add(ht, idx, pData);
    } else {
        return zend_hash_str_add(ht, str, len, pData);
    }
}
@Girgias
Copy link
Member

Girgias commented Aug 27, 2024

Why not just submit a PR? I don't see any reason not to have it, but opening an issue doesn't seem to do much?

@nielsdos
Copy link
Member

Please send a PR, this issue on its own won't do anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants