diff --git a/systemd.c b/systemd.c index 9479556..6a0d573 100644 --- a/systemd.c +++ b/systemd.c @@ -30,7 +30,11 @@ ZEND_GET_MODULE(systemd) PHP_FUNCTION(sd_journal_send) { struct iovec *iov = NULL; +#if ZEND_MODULE_API_NO >= 20151012 + zval *args; +#else zval ***args; +#endif int argc, len, i; char *val; @@ -47,9 +51,15 @@ PHP_FUNCTION(sd_journal_send) // Iterate through the PHP arguments and fill the iovector. for (i = 0; i < ZEND_NUM_ARGS() TSRMLS_CC; ++i) { +#if ZEND_MODULE_API_NO >= 20151012 + convert_to_string_ex(&args[i]); + val = Z_STRVAL(args[i]); + len = Z_STRLEN(args[i]); +#else convert_to_string_ex(args[i]); val = Z_STRVAL_PP(args[i]); len = Z_STRLEN_PP(args[i]); +#endif iov[i].iov_base = val; iov[i].iov_len = len; }