summaryrefslogtreecommitdiff
path: root/ext/dom
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2014-04-25 12:32:30 +0200
committerNikita Popov <nikic@php.net>2014-04-25 23:21:04 +0200
commitf979e9afb0f9271e0677f65905bfc26759d91e00 (patch)
treebbfe983ebf3c91d3074027e7011f66c36ccd7068 /ext/dom
parentf9927a6c97208c60d922f9a4e98feb8079c57d1f (diff)
downloadphp-git-f979e9afb0f9271e0677f65905bfc26759d91e00.tar.gz
More zend_string usage in PCRE
Avoid a few copies and zval duplications
Diffstat (limited to 'ext/dom')
-rw-r--r--ext/dom/xpath.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/dom/xpath.c b/ext/dom/xpath.c
index 3290a3a5e7..32adfe3b6f 100644
--- a/ext/dom/xpath.c
+++ b/ext/dom/xpath.c
@@ -221,8 +221,9 @@ static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs,
php_error_docref(NULL TSRMLS_CC, E_WARNING, "A PHP Object cannot be converted to a XPath-string");
valuePush(ctxt, xmlXPathNewString((xmlChar *)""));
} else {
- convert_to_string_ex(&retval);
- valuePush(ctxt, xmlXPathNewString(Z_STRVAL(retval)));
+ zend_string *str = zval_get_string(&retval);
+ valuePush(ctxt, xmlXPathNewString(str->val));
+ STR_RELEASE(str);
}
zval_ptr_dtor(&retval);
}