diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-01-07 12:28:51 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-01-11 15:49:06 +0100 |
commit | e219ec144ef6682b71e135fd18654ee1bb4676b4 (patch) | |
tree | e4a3ae2b619cdc9fe50ee8e1fa5adb99d804dddf /ext/xmlrpc/xmlrpc-epi-php.c | |
parent | fe8fdfa3bd588d80ce60f6b3848058239e0a760f (diff) | |
download | php-git-e219ec144ef6682b71e135fd18654ee1bb4676b4.tar.gz |
Implement typed properties
RFC: https://wiki.php.net/rfc/typed_properties_v2
This is a squash of PR #3734, which is a squash of PR #3313.
Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
Co-authored-by: Joe Watkins <krakjoe@php.net>
Co-authored-by: Dmitry Stogov <dmitry@zend.com>
Diffstat (limited to 'ext/xmlrpc/xmlrpc-epi-php.c')
-rw-r--r-- | ext/xmlrpc/xmlrpc-epi-php.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/ext/xmlrpc/xmlrpc-epi-php.c b/ext/xmlrpc/xmlrpc-epi-php.c index 737a3f84a5..937f7b1b0f 100644 --- a/ext/xmlrpc/xmlrpc-epi-php.c +++ b/ext/xmlrpc/xmlrpc-epi-php.c @@ -764,11 +764,9 @@ void decode_request_worker(char *xml_in, int xml_in_len, char *encoding_in, zval if (method_name_out) { method_name = XMLRPC_RequestGetMethodName(response); if (method_name) { - zval_ptr_dtor(method_name_out); - ZVAL_STRING(method_name_out, method_name); + ZEND_TRY_ASSIGN_STRING(method_name_out, method_name); } else { - zval_ptr_dtor(retval); - ZVAL_NULL(retval); + ZEND_TRY_ASSIGN_NULL(retval); } } } @@ -787,7 +785,7 @@ PHP_FUNCTION(xmlrpc_decode_request) zval *method; size_t xml_len, encoding_len = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz/|s", &xml, &xml_len, &method, &encoding, &encoding_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz|s", &xml, &xml_len, &method, &encoding, &encoding_len) == FAILURE) { return; } @@ -1389,15 +1387,19 @@ PHP_FUNCTION(xmlrpc_set_type) size_t type_len; XMLRPC_VALUE_TYPE vtype; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "z/s", &arg, &type, &type_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "zs", &arg, &type, &type_len) == FAILURE) { return; } vtype = xmlrpc_str_as_type(type); if (vtype != xmlrpc_none) { - if (set_zval_xmlrpc_type(arg, vtype) == SUCCESS) { + zval tmp; + ZVAL_COPY(&tmp, Z_REFVAL_P(arg)); + if (set_zval_xmlrpc_type(&tmp, vtype) == SUCCESS) { + ZEND_TRY_ASSIGN_VALUE(arg, &tmp); RETURN_TRUE; } + Z_TRY_DELREF(tmp); } else { zend_error(E_WARNING,"invalid type '%s' passed to xmlrpc_set_type()", type); } |