diff options
| -rw-r--r-- | ext/soap/php_encoding.c | 8 | ||||
| -rw-r--r-- | ext/standard/string.c | 13 |
2 files changed, 6 insertions, 15 deletions
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index 97191652d6..9e554a9f5a 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -3134,11 +3134,9 @@ static xmlNodePtr to_xml_any(encodeTypePtr type, zval *data, int style, xmlNodeP if (Z_TYPE_P(data) == IS_STRING) { ret = xmlNewTextLen(BAD_CAST(Z_STRVAL_P(data)), Z_STRLEN_P(data)); } else { - zval tmp; - - ZVAL_STR(&tmp, zval_get_string(data)); - ret = xmlNewTextLen(BAD_CAST(Z_STRVAL(tmp)), Z_STRLEN(tmp)); - zval_dtor(&tmp); + zend_string *tmp = zval_get_string(data); + ret = xmlNewTextLen(BAD_CAST(tmp->val), tmp->len); + zend_string_release(tmp); } ret->name = xmlStringTextNoenc; diff --git a/ext/standard/string.c b/ext/standard/string.c index 5d5f4324f5..ec86b08d3c 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -1672,18 +1672,11 @@ static int php_needle_char(zval *needle, char *target TSRMLS_DC) *target = (char)(int)Z_DVAL_P(needle); return SUCCESS; case IS_OBJECT: - { - zval holder; - - ZVAL_LONG(&holder, zval_get_long(needle)); - - *target = (char)Z_LVAL(holder); - return SUCCESS; - } - default: { + *target = (char) zval_get_long(needle); + return SUCCESS; + default: php_error_docref(NULL TSRMLS_CC, E_WARNING, "needle is not a string or an integer"); return FAILURE; - } } } /* }}} */ |
