- tmp = php_addslashes(Z_STRVAL_P(zcopy), Z_STRLEN_P(zcopy), &tmp_len, 0 TSRMLS_CC);
- smart_str_appendc(s, '"');
- smart_str_appendl(s, tmp, tmp_len);
- smart_str_appendc(s, '"');
-
- if (zcopy != *zparam) {
- zval_ptr_dtor(&zcopy);
- }
- efree(tmp);
+#if PHP_VERSION_ID < 70300
+ str = php_addslashes(tmpstr, 1);
+#else
+ str = php_addslashes(tmpstr);
+ zend_string_release(tmpstr);
+#endif
+ smart_str_appendc(arg->buffer, '"');
+ smart_str_appendl(arg->buffer, str->val, str->len);
+ smart_str_appendc(arg->buffer, '"');
+ zend_string_release(str);