diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2021-02-10 10:36:32 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2021-02-10 10:36:32 +0100 |
commit | 32d128d219f2d2d0767103091b4209a28f48b4ac (patch) | |
tree | d68f140e8ac700e60298f0925c42e7b7e49939f2 | |
parent | 45fa7596dc4247fc8750b4bdb7a57f020997925e (diff) | |
download | php-git-32d128d219f2d2d0767103091b4209a28f48b4ac.tar.gz |
Make SoapVar arguments nullable
$typeName, $typeNamespace, $nodeName and $nodeNamespace all
special-case the empty string and don't set the property entirely
in that case. It makes more sense to use null to indicate absence
here (though of course the empty string behavior is retained).
-rw-r--r-- | ext/soap/soap.c | 2 | ||||
-rw-r--r-- | ext/soap/soap.stub.php | 2 | ||||
-rw-r--r-- | ext/soap/soap_arginfo.h | 10 |
3 files changed, 7 insertions, 7 deletions
diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 861d8ebf5d..82657caad6 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -693,7 +693,7 @@ PHP_METHOD(SoapVar, __construct) char *stype = NULL, *ns = NULL, *name = NULL, *namens = NULL; size_t stype_len = 0, ns_len = 0, name_len = 0, namens_len = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "z!l!|ssss", &data, &type, &type_is_null, &stype, &stype_len, &ns, &ns_len, &name, &name_len, &namens, &namens_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z!l!|s!s!s!s!", &data, &type, &type_is_null, &stype, &stype_len, &ns, &ns_len, &name, &name_len, &namens, &namens_len) == FAILURE) { RETURN_THROWS(); } diff --git a/ext/soap/soap.stub.php b/ext/soap/soap.stub.php index fd4c84bdb2..298374e866 100644 --- a/ext/soap/soap.stub.php +++ b/ext/soap/soap.stub.php @@ -25,7 +25,7 @@ class SoapFault extends Exception class SoapVar { - public function __construct(mixed $data, ?int $encoding, string $typeName = "", string $typeNamespace = "", string $nodeName = "", string $nodeNamespace = "") {} + public function __construct(mixed $data, ?int $encoding, ?string $typeName = null, ?string $typeNamespace = null, ?string $nodeName = null, ?string $nodeNamespace = null) {} } class SoapServer diff --git a/ext/soap/soap_arginfo.h b/ext/soap/soap_arginfo.h index 76824922de..e9bf6fbc8f 100644 --- a/ext/soap/soap_arginfo.h +++ b/ext/soap/soap_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 4f958b1c954386207619cfaefa02c96e90cc0da7 */ + * Stub hash: b22d29a51c17d627763229aac15718702002daec */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_use_soap_error_handler, 0, 0, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, enable, _IS_BOOL, 0, "true") @@ -37,10 +37,10 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SoapVar___construct, 0, 0, 2) ZEND_ARG_TYPE_INFO(0, data, IS_MIXED, 0) ZEND_ARG_TYPE_INFO(0, encoding, IS_LONG, 1) - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, typeName, IS_STRING, 0, "\"\"") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, typeNamespace, IS_STRING, 0, "\"\"") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, nodeName, IS_STRING, 0, "\"\"") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, nodeNamespace, IS_STRING, 0, "\"\"") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, typeName, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, typeNamespace, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, nodeName, IS_STRING, 1, "null") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, nodeNamespace, IS_STRING, 1, "null") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SoapServer___construct, 0, 0, 1) |