Skip to content

Commit c4dce3b

Browse files
committed
Add more accurate types to stubs
1 parent 397a692 commit c4dce3b

29 files changed

+261
-286
lines changed

Zend/zend_API.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,8 +1221,8 @@ static zend_always_inline zval *zend_try_array_init(zval *zv)
12211221
_(Z_EXPECTED_DOUBLE_OR_NULL, "of type ?float") \
12221222
_(Z_EXPECTED_NUMBER, "of type int|float") \
12231223
_(Z_EXPECTED_NUMBER_OR_NULL, "of type int|float|null") \
1224-
_(Z_EXPECTED_STRING_OR_ARRAY, "of type string|array") \
1225-
_(Z_EXPECTED_STRING_OR_ARRAY_OR_NULL, "of type string|array|null") \
1224+
_(Z_EXPECTED_STRING_OR_ARRAY, "of type array|string") \
1225+
_(Z_EXPECTED_STRING_OR_ARRAY_OR_NULL, "of type array|string|null") \
12261226
_(Z_EXPECTED_STRING_OR_LONG, "of type string|int") \
12271227
_(Z_EXPECTED_STRING_OR_LONG_OR_NULL, "of type string|int|null") \
12281228
_(Z_EXPECTED_CLASS_NAME_OR_OBJECT, "a valid class name or object") \
@@ -1511,6 +1511,9 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *
15111511
#define Z_PARAM_ARRAY_HT(dest) \
15121512
Z_PARAM_ARRAY_HT_EX(dest, 0, 0)
15131513

1514+
#define Z_PARAM_ARRAY_HT_OR_NULL(dest) \
1515+
Z_PARAM_ARRAY_HT_EX(dest, 1, 0)
1516+
15141517
/* old "H" */
15151518
#define Z_PARAM_ARRAY_OR_OBJECT_HT_EX2(dest, check_null, deref, separate) \
15161519
Z_PARAM_PROLOGUE(deref, separate); \

ext/intl/formatter/formatter.stub.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,10 @@ public function formatCurrency(float $value, string $currency) {}
4040
public function parseCurrency(string $value, &$currency, &$position = null) {}
4141

4242
/**
43-
* @param int|float $value
4443
* @return bool
4544
* @alias numfmt_set_attribute
4645
*/
47-
public function setAttribute(int $attr, $value) {}
46+
public function setAttribute(int $attr, int|float $value) {}
4847

4948
/**
5049
* @return int|float|false

ext/intl/formatter/formatter_arginfo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 041569278b83b65f67fb4848d00d5423e6728165 */
2+
* Stub hash: 60a05cccb434edadeec01cb7d43f919c276ce24d */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_NumberFormatter___construct, 0, 0, 2)
55
ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 0)
@@ -33,7 +33,7 @@ ZEND_END_ARG_INFO()
3333

3434
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_NumberFormatter_setAttribute, 0, 0, 2)
3535
ZEND_ARG_TYPE_INFO(0, attr, IS_LONG, 0)
36-
ZEND_ARG_INFO(0, value)
36+
ZEND_ARG_TYPE_MASK(0, value, MAY_BE_LONG|MAY_BE_DOUBLE, NULL)
3737
ZEND_END_ARG_INFO()
3838

3939
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_NumberFormatter_getAttribute, 0, 0, 1)

ext/intl/formatter/formatter_attr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ PHP_FUNCTION( numfmt_set_attribute )
129129
FORMATTER_METHOD_INIT_VARS;
130130

131131
/* Parse parameters. */
132-
if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Olz",
132+
if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Oln",
133133
&object, NumberFormatter_ce_ptr, &attribute, &value ) == FAILURE)
134134
{
135135
RETURN_THROWS();

ext/intl/php_intl.stub.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,7 @@ function numfmt_format_currency(NumberFormatter $fmt, float $value, string $curr
223223
*/
224224
function numfmt_parse_currency(NumberFormatter $fmt, string $value, &$currency, &$position = null): float|false {}
225225

226-
/** @param int|float $value */
227-
function numfmt_set_attribute(NumberFormatter $fmt, int $attr, $value): bool {}
226+
function numfmt_set_attribute(NumberFormatter $fmt, int $attr, int|float $value): bool {}
228227

229228
function numfmt_get_attribute(NumberFormatter $fmt, int $attr): int|float|false {}
230229

ext/intl/php_intl_arginfo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 9284fbafde8c7430a30a8fff5537bf9e6d9c6125 */
2+
* Stub hash: fdc7c500ddc5bc560ec54b7ce12d5961a4697a63 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_intlcal_create_instance, 0, 0, IntlCalendar, 1)
55
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, timeZone, "null")
@@ -402,7 +402,7 @@ ZEND_END_ARG_INFO()
402402
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_numfmt_set_attribute, 0, 3, _IS_BOOL, 0)
403403
ZEND_ARG_OBJ_INFO(0, fmt, NumberFormatter, 0)
404404
ZEND_ARG_TYPE_INFO(0, attr, IS_LONG, 0)
405-
ZEND_ARG_INFO(0, value)
405+
ZEND_ARG_TYPE_MASK(0, value, MAY_BE_LONG|MAY_BE_DOUBLE, NULL)
406406
ZEND_END_ARG_INFO()
407407

408408
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_numfmt_get_attribute, 0, 2, MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_FALSE)

ext/ldap/ldap.c

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1423,7 +1423,9 @@ static void php_set_opts(LDAP *ldap, int sizelimit, int timelimit, int deref, in
14231423
/* {{{ php_ldap_do_search */
14241424
static void php_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope)
14251425
{
1426-
zval *link, *base_dn, *filter, *attrs = NULL, *attr, *serverctrls = NULL;
1426+
zval *link, *attrs = NULL, *attr, *serverctrls = NULL;
1427+
zend_string *base_dn_str, *filter_str;
1428+
HashTable *base_dn_ht, *filter_ht;
14271429
zend_long attrsonly, sizelimit, timelimit, deref;
14281430
zend_string *ldap_filter = NULL, *ldap_base_dn = NULL;
14291431
char **ldap_attrs = NULL;
@@ -1434,10 +1436,17 @@ static void php_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope)
14341436
int old_ldap_sizelimit = -1, old_ldap_timelimit = -1, old_ldap_deref = -1;
14351437
int num_attribs = 0, ret = 1, i, errno, argcount = ZEND_NUM_ARGS();
14361438

1437-
if (zend_parse_parameters(argcount, "zzz|a/lllla/", &link, &base_dn, &filter, &attrs, &attrsonly,
1438-
&sizelimit, &timelimit, &deref, &serverctrls) == FAILURE) {
1439-
RETURN_THROWS();
1440-
}
1439+
ZEND_PARSE_PARAMETERS_START(3, 9)
1440+
Z_PARAM_ZVAL(link)
1441+
Z_PARAM_STR_OR_ARRAY_HT(base_dn_str, base_dn_ht)
1442+
Z_PARAM_STR_OR_ARRAY_HT(filter_str, filter_ht)
1443+
Z_PARAM_OPTIONAL
1444+
Z_PARAM_ARRAY_EX(attrs, 0, 1)
1445+
Z_PARAM_LONG(attrsonly)
1446+
Z_PARAM_LONG(sizelimit)
1447+
Z_PARAM_LONG(timelimit)
1448+
Z_PARAM_ARRAY_EX(serverctrls, 0, 1)
1449+
ZEND_PARSE_PARAMETERS_END();
14411450

14421451
/* Reverse -> fall through */
14431452
switch (argcount) {
@@ -1486,34 +1495,34 @@ static void php_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope)
14861495
goto cleanup;
14871496
}
14881497

1489-
if (Z_TYPE_P(base_dn) == IS_ARRAY) {
1490-
nbases = zend_hash_num_elements(Z_ARRVAL_P(base_dn));
1498+
if (base_dn_ht) {
1499+
nbases = zend_hash_num_elements(base_dn_ht);
14911500
if (nbases != nlinks) {
14921501
php_error_docref(NULL, E_WARNING, "Base must either be a string, or an array with the same number of elements as the links array");
14931502
ret = 0;
14941503
goto cleanup;
14951504
}
1496-
zend_hash_internal_pointer_reset(Z_ARRVAL_P(base_dn));
1505+
zend_hash_internal_pointer_reset(base_dn_ht);
14971506
} else {
14981507
nbases = 0; /* this means string, not array */
1499-
ldap_base_dn = zval_get_string(base_dn);
1508+
ldap_base_dn = zend_string_copy(base_dn_str);
15001509
if (EG(exception)) {
15011510
ret = 0;
15021511
goto cleanup;
15031512
}
15041513
}
15051514

1506-
if (Z_TYPE_P(filter) == IS_ARRAY) {
1507-
nfilters = zend_hash_num_elements(Z_ARRVAL_P(filter));
1515+
if (filter_ht) {
1516+
nfilters = zend_hash_num_elements(filter_ht);
15081517
if (nfilters != nlinks) {
15091518
php_error_docref(NULL, E_WARNING, "Filter must either be a string, or an array with the same number of elements as the links array");
15101519
ret = 0;
15111520
goto cleanup;
15121521
}
1513-
zend_hash_internal_pointer_reset(Z_ARRVAL_P(filter));
1522+
zend_hash_internal_pointer_reset(filter_ht);
15141523
} else {
15151524
nfilters = 0; /* this means string, not array */
1516-
ldap_filter = zval_get_string(filter);
1525+
ldap_filter = zend_string_copy(filter_str);
15171526
if (EG(exception)) {
15181527
ret = 0;
15191528
goto cleanup;

ext/ldap/ldap.stub.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,27 +35,21 @@ function ldap_sasl_bind($link, string $binddn = UNKNOWN, string $password = UNKN
3535

3636
/**
3737
* @param resource|array $link_identifier
38-
* @param string|array $base_dn
39-
* @param string|array $filter
4038
* @return resource|false
4139
*/
42-
function ldap_read($link_identifier, $base_dn, $filter, array $attributes = [], int $attrsonly = 0, int $sizelimit = -1, int $timelimit = -1, int $deref = LDAP_DEREF_NEVER, array $servercontrols = []) {}
40+
function ldap_read($link_identifier, array|string $base_dn, array|string $filter, array $attributes = [], int $attrsonly = 0, int $sizelimit = -1, int $timelimit = -1, int $deref = LDAP_DEREF_NEVER, array $servercontrols = []) {}
4341

4442
/**
4543
* @param resource|array $link_identifier
46-
* @param string|array $base_dn
47-
* @param string|array $filter
4844
* @return resource|false
4945
*/
50-
function ldap_list($link_identifier, $base_dn, $filter, array $attributes = [], int $attrsonly = 0, int $sizelimit = -1, int $timelimit = -1, int $deref = LDAP_DEREF_NEVER, array $servercontrols = []) {}
46+
function ldap_list($link_identifier, array|string $base_dn, array|string $filter, array $attributes = [], int $attrsonly = 0, int $sizelimit = -1, int $timelimit = -1, int $deref = LDAP_DEREF_NEVER, array $servercontrols = []) {}
5147

5248
/**
5349
* @param resource|array $link_identifier
54-
* @param string|array $base_dn
55-
* @param string|array $filter
5650
* @return resource|false
5751
*/
58-
function ldap_search($link_identifier, $base_dn, $filter, array $attributes = [], int $attrsonly = 0, int $sizelimit = -1, int $timelimit = -1, int $deref = LDAP_DEREF_NEVER, array $servercontrols = []) {}
52+
function ldap_search($link_identifier, array|string $base_dn, array|string $filter, array $attributes = [], int $attrsonly = 0, int $sizelimit = -1, int $timelimit = -1, int $deref = LDAP_DEREF_NEVER, array $servercontrols = []) {}
5953

6054
/** @param resource $link_identifier */
6155
function ldap_free_result($link_identifier): bool {}

ext/ldap/ldap_arginfo.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 6b5e8ddfbdc436fab3a263d6922146ca7c2f3845 */
2+
* Stub hash: c247d438a69d40353a629b09c5200d33ed8218ee */
33

44
#if defined(HAVE_ORALDAP)
55
ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_connect, 0, 0, 0)
@@ -52,8 +52,8 @@ ZEND_END_ARG_INFO()
5252

5353
ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_read, 0, 0, 3)
5454
ZEND_ARG_INFO(0, link_identifier)
55-
ZEND_ARG_INFO(0, base_dn)
56-
ZEND_ARG_INFO(0, filter)
55+
ZEND_ARG_TYPE_MASK(0, base_dn, MAY_BE_ARRAY|MAY_BE_STRING, NULL)
56+
ZEND_ARG_TYPE_MASK(0, filter, MAY_BE_ARRAY|MAY_BE_STRING, NULL)
5757
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, attributes, IS_ARRAY, 0, "[]")
5858
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, attrsonly, IS_LONG, 0, "0")
5959
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, sizelimit, IS_LONG, 0, "-1")

ext/pcre/tests/preg_replace_error1.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ string(1) "a"
5656

5757
Arg value is /[a-zA-Z]/
5858
string(1) "1"
59-
preg_replace(): Argument #1 ($regex) must be of type string|array, stdClass given
59+
preg_replace(): Argument #1 ($regex) must be of type array|string, stdClass given

ext/pcre/tests/preg_replace_error2.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ string(64) "this is a stringthis is a stringthis is a stringthis is a string"
3636

3737
Arg value is: Array
3838
preg_replace(): Argument #1 ($regex) must be of type array when argument #2 ($replace) is an array, string given
39-
preg_replace(): Argument #2 ($replace) must be of type string|array, stdClass given
39+
preg_replace(): Argument #2 ($replace) must be of type array|string, stdClass given
4040
Done

ext/phar/tests/phar_extract.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ string(2) "hi"
141141
string(3) "hi3"
142142
string(3) "hi2"
143143
bool(false)
144-
Phar::extractTo(): Argument #2 ($files) must be of type string|array|null, stdClass given
144+
Phar::extractTo(): Argument #2 ($files) must be of type array|string|null, stdClass given
145145
Phar::extractTo(): Argument #1 ($pathto) must be a valid path, array given
146146
Invalid argument, extraction path must be non-zero length
147147
Unable to use path "%soops" for extraction, it is a file, must be a directory

ext/snmp/snmp.c

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -659,8 +659,10 @@ static void php_snmp_internal(INTERNAL_FUNCTION_PARAMETERS, int st,
659659
* OID parser (and type, value for SNMP_SET command)
660660
*/
661661

662-
static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_query, zend_string *oid_str, HashTable *oid_ht, zval *type, zval *value)
663-
{
662+
static int php_snmp_parse_oid(
663+
zval *object, int st, struct objid_query *objid_query, zend_string *oid_str, HashTable *oid_ht,
664+
zend_string *type_str, HashTable *type_ht, zend_string *value_str, HashTable *value_ht
665+
) {
664666
char *pptr;
665667
uint32_t idx_type = 0, idx_value = 0;
666668
zval *tmp_oid, *tmp_type, *tmp_value;
@@ -671,15 +673,15 @@ static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_qu
671673
objid_query->vars = (snmpobjarg *)emalloc(sizeof(snmpobjarg));
672674
objid_query->vars[objid_query->count].oid = ZSTR_VAL(oid_str);
673675
if (st & SNMP_CMD_SET) {
674-
if (Z_TYPE_P(type) == IS_STRING && Z_TYPE_P(value) == IS_STRING) {
675-
if (Z_STRLEN_P(type) != 1) {
676-
php_error_docref(NULL, E_WARNING, "Bogus type '%s', should be single char, got %zu", Z_STRVAL_P(type), Z_STRLEN_P(type));
676+
if (type_str && value_str) {
677+
if (ZSTR_LEN(type_str) != 1) {
678+
php_error_docref(NULL, E_WARNING, "Bogus type '%s', should be single char, got %zu", ZSTR_VAL(type_str), ZSTR_LEN(type_str));
677679
efree(objid_query->vars);
678680
return FALSE;
679681
}
680-
pptr = Z_STRVAL_P(type);
682+
pptr = ZSTR_VAL(type_str);
681683
objid_query->vars[objid_query->count].type = *pptr;
682-
objid_query->vars[objid_query->count].value = Z_STRVAL_P(value);
684+
objid_query->vars[objid_query->count].value = ZSTR_VAL(value_str);
683685
} else {
684686
php_error_docref(NULL, E_WARNING, "Single objid and multiple type or values are not supported");
685687
efree(objid_query->vars);
@@ -698,18 +700,18 @@ static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_qu
698700
convert_to_string_ex(tmp_oid);
699701
objid_query->vars[objid_query->count].oid = Z_STRVAL_P(tmp_oid);
700702
if (st & SNMP_CMD_SET) {
701-
if (Z_TYPE_P(type) == IS_STRING) {
702-
pptr = Z_STRVAL_P(type);
703+
if (type_str) {
704+
pptr = ZSTR_VAL(type_str);
703705
objid_query->vars[objid_query->count].type = *pptr;
704-
} else if (Z_TYPE_P(type) == IS_ARRAY) {
705-
while (idx_type < Z_ARRVAL_P(type)->nNumUsed) {
706-
tmp_type = &Z_ARRVAL_P(type)->arData[idx_type].val;
706+
} else if (type_ht) {
707+
while (idx_type < type_ht->nNumUsed) {
708+
tmp_type = &type_ht->arData[idx_type].val;
707709
if (Z_TYPE_P(tmp_type) != IS_UNDEF) {
708710
break;
709711
}
710712
idx_type++;
711713
}
712-
if (idx_type < Z_ARRVAL_P(type)->nNumUsed) {
714+
if (idx_type < type_ht->nNumUsed) {
713715
convert_to_string_ex(tmp_type);
714716
if (Z_STRLEN_P(tmp_type) != 1) {
715717
php_error_docref(NULL, E_WARNING, "'%s': bogus type '%s', should be single char, got %zu", Z_STRVAL_P(tmp_oid), Z_STRVAL_P(tmp_type), Z_STRLEN_P(tmp_type));
@@ -726,17 +728,17 @@ static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_qu
726728
}
727729
}
728730

729-
if (Z_TYPE_P(value) == IS_STRING) {
730-
objid_query->vars[objid_query->count].value = Z_STRVAL_P(value);
731-
} else if (Z_TYPE_P(value) == IS_ARRAY) {
732-
while (idx_value < Z_ARRVAL_P(value)->nNumUsed) {
733-
tmp_value = &Z_ARRVAL_P(value)->arData[idx_value].val;
731+
if (value_str) {
732+
objid_query->vars[objid_query->count].value = ZSTR_VAL(value_str);
733+
} else if (value_ht) {
734+
while (idx_value < value_ht->nNumUsed) {
735+
tmp_value = &value_ht->arData[idx_value].val;
734736
if (Z_TYPE_P(tmp_value) != IS_UNDEF) {
735737
break;
736738
}
737739
idx_value++;
738740
}
739-
if (idx_value < Z_ARRVAL_P(value)->nNumUsed) {
741+
if (idx_value < value_ht->nNumUsed) {
740742
convert_to_string_ex(tmp_value);
741743
objid_query->vars[objid_query->count].value = Z_STRVAL_P(tmp_value);
742744
idx_value++;
@@ -1077,9 +1079,8 @@ static int netsnmp_session_set_security(struct snmp_session *session, char *sec_
10771079
*/
10781080
static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version)
10791081
{
1080-
zend_string *oid_str;
1081-
HashTable *oid_ht;
1082-
zval *value = NULL, *type = NULL;
1082+
zend_string *oid_str, *type_str = NULL, *value_str = NULL;
1083+
HashTable *oid_ht, *type_ht = NULL, *value_ht = NULL;
10831084
char *a1, *a2, *a3, *a4, *a5, *a6, *a7;
10841085
size_t a1_len, a2_len, a3_len, a4_len, a5_len, a6_len, a7_len;
10851086
zend_bool use_orignames = 0, suffix_keys = 0;
@@ -1109,8 +1110,8 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version)
11091110
Z_PARAM_STRING(a6, a6_len)
11101111
Z_PARAM_STRING(a7, a7_len)
11111112
Z_PARAM_STR_OR_ARRAY_HT(oid_str, oid_ht)
1112-
Z_PARAM_ZVAL(type)
1113-
Z_PARAM_ZVAL(value)
1113+
Z_PARAM_STR_OR_ARRAY_HT(type_str, type_ht)
1114+
Z_PARAM_STR_OR_ARRAY_HT(value_str, value_ht)
11141115
Z_PARAM_OPTIONAL
11151116
Z_PARAM_LONG(timeout)
11161117
Z_PARAM_LONG(retries)
@@ -1140,8 +1141,8 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version)
11401141
Z_PARAM_STRING(a1, a1_len)
11411142
Z_PARAM_STRING(a2, a2_len)
11421143
Z_PARAM_STR_OR_ARRAY_HT(oid_str, oid_ht)
1143-
Z_PARAM_ZVAL(type)
1144-
Z_PARAM_ZVAL(value)
1144+
Z_PARAM_STR_OR_ARRAY_HT(type_str, type_ht)
1145+
Z_PARAM_STR_OR_ARRAY_HT(value_str, value_ht)
11451146
Z_PARAM_OPTIONAL
11461147
Z_PARAM_LONG(timeout)
11471148
Z_PARAM_LONG(retries)
@@ -1165,8 +1166,8 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version)
11651166
if (st & SNMP_CMD_SET) {
11661167
ZEND_PARSE_PARAMETERS_START(3, 3)
11671168
Z_PARAM_STR_OR_ARRAY_HT(oid_str, oid_ht)
1168-
Z_PARAM_ZVAL(type)
1169-
Z_PARAM_ZVAL(value)
1169+
Z_PARAM_STR_OR_ARRAY_HT(type_str, type_ht)
1170+
Z_PARAM_STR_OR_ARRAY_HT(value_str, value_ht)
11701171
ZEND_PARSE_PARAMETERS_END();
11711172
} else if (st & SNMP_CMD_WALK) {
11721173
ZEND_PARSE_PARAMETERS_START(1, 4)
@@ -1197,7 +1198,7 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version)
11971198
}
11981199
}
11991200

1200-
if (!php_snmp_parse_oid(getThis(), st, &objid_query, oid_str, oid_ht, type, value)) {
1201+
if (!php_snmp_parse_oid(getThis(), st, &objid_query, oid_str, oid_ht, type_str, type_ht, value_str, value_ht)) {
12011202
RETURN_FALSE;
12021203
}
12031204

0 commit comments

Comments
 (0)