Skip to content

Pass array by reference and modify inside function #2

@gorazdr

Description

@gorazdr

I have something like this:
PHP_FUNCTION(modify) {
smart_str ss = { 0 };
zval *val;
long opts = 0;
zval *strings ;
HashTable sht;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zla", &val, &opts, &strings) == FAILURE) return;
sht = Z_ARRVAL_P(strings) ;
cmodify(&ss, val, opts, &sht TSRML_CC) ;
RETVAL_STRINGL(ss.c, ss.len, 1);
smart_str_free(&ss);
}

cmodify expects sht to be HashTable but I would like strings(array) could replace sht

Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions