stackdriver_trace_span.c
/* Update the provided span with the provided zval (array) of span options */
Update the provided span with the provided zval (array) of span options
Update the provided span with the provided zval ( array ) of span options
int stackdriver_trace_span_apply_span_options(stackdriver_trace_span_t *span,
                                              zval *span_options)
{
    zend_string *k;
    zval *v;
    ZEND_HASH_FOREACH_STR_KEY_VAL(Z_ARR_P(span_options), k, v) {
        if (strcmp(ZSTR_VAL(k), "labels") == 0) {
            zend_hash_merge(span->labels, Z_ARRVAL_P(v), zval_add_ref, 0);
        } else if (strcmp(ZSTR_VAL(k), "startTime") == 0) {
            span->start = Z_DVAL_P(v);
        } else if (strcmp(ZSTR_VAL(k), "name") == 0) {
            span->name = zend_string_copy(Z_STR_P(v));
        }
    } ZEND_HASH_FOREACH_END();
    return SUCCESS;
}
int stackdriver_trace_span_apply_span_options ( stackdriver_trace_span_t * span , zval * span_options ) { zend_string * k ; zval * v ; ZEND_HASH_FOREACH_STR_KEY_VAL ( Z_ARR_P ( span_options ) , k , v ) { if ( strcmp ( ZSTR_VAL ( k ) , " " ) == 0 ) { zend_hash_merge ( span -> labels , Z_ARRVAL_P ( v ) , zval_add_ref , 0 ) ; } else if ( strcmp ( ZSTR_VAL ( k ) , " " ) == 0 ) { span -> start = Z_DVAL_P ( v ) ; } else if ( strcmp ( ZSTR_VAL ( k ) , " " ) == 0 ) { span -> name = zend_string_copy ( Z_STR_P ( v ) ) ; } } ZEND_HASH_FOREACH_END ( ) ; return SUCCESS ; }
Update the provided span with the provided zval (array) of span options
Update the provided span with the provided zval ( array ) of span options