Skip to content

Add more accurate types to stubs again #6068

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Zend/zend_API.h
Original file line number Diff line number Diff line change
Expand Up @@ -1221,8 +1221,8 @@ static zend_always_inline zval *zend_try_array_init(zval *zv)
_(Z_EXPECTED_DOUBLE_OR_NULL, "of type ?float") \
_(Z_EXPECTED_NUMBER, "of type int|float") \
_(Z_EXPECTED_NUMBER_OR_NULL, "of type int|float|null") \
_(Z_EXPECTED_STRING_OR_ARRAY, "of type string|array") \
_(Z_EXPECTED_STRING_OR_ARRAY_OR_NULL, "of type string|array|null") \
_(Z_EXPECTED_STRING_OR_ARRAY, "of type array|string") \
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So that we use the canonical form. I'll carve out these changes to a separate commit.

_(Z_EXPECTED_STRING_OR_ARRAY_OR_NULL, "of type array|string|null") \
_(Z_EXPECTED_STRING_OR_LONG, "of type string|int") \
_(Z_EXPECTED_STRING_OR_LONG_OR_NULL, "of type string|int|null") \
_(Z_EXPECTED_CLASS_NAME_OR_OBJECT, "a valid class name or object") \
Expand Down Expand Up @@ -1511,6 +1511,9 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *
#define Z_PARAM_ARRAY_HT(dest) \
Z_PARAM_ARRAY_HT_EX(dest, 0, 0)

#define Z_PARAM_ARRAY_HT_OR_NULL(dest) \
Z_PARAM_ARRAY_HT_EX(dest, 1, 0)

/* old "H" */
#define Z_PARAM_ARRAY_OR_OBJECT_HT_EX2(dest, check_null, deref, separate) \
Z_PARAM_PROLOGUE(deref, separate); \
Expand Down
3 changes: 1 addition & 2 deletions ext/intl/formatter/formatter.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,10 @@ public function formatCurrency(float $value, string $currency) {}
public function parseCurrency(string $value, &$currency, &$position = null) {}

/**
* @param int|float $value
* @return bool
* @alias numfmt_set_attribute
*/
public function setAttribute(int $attr, $value) {}
public function setAttribute(int $attr, int|float $value) {}

/**
* @return int|float|false
Expand Down
4 changes: 2 additions & 2 deletions ext/intl/formatter/formatter_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 041569278b83b65f67fb4848d00d5423e6728165 */
* Stub hash: 60a05cccb434edadeec01cb7d43f919c276ce24d */

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_NumberFormatter___construct, 0, 0, 2)
ZEND_ARG_TYPE_INFO(0, locale, IS_STRING, 0)
Expand Down Expand Up @@ -33,7 +33,7 @@ ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_NumberFormatter_setAttribute, 0, 0, 2)
ZEND_ARG_TYPE_INFO(0, attr, IS_LONG, 0)
ZEND_ARG_INFO(0, value)
ZEND_ARG_TYPE_MASK(0, value, MAY_BE_LONG|MAY_BE_DOUBLE, NULL)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_NumberFormatter_getAttribute, 0, 0, 1)
Expand Down
2 changes: 1 addition & 1 deletion ext/intl/formatter/formatter_attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ PHP_FUNCTION( numfmt_set_attribute )
FORMATTER_METHOD_INIT_VARS;

/* Parse parameters. */
if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Olz",
if( zend_parse_method_parameters( ZEND_NUM_ARGS(), getThis(), "Oln",
&object, NumberFormatter_ce_ptr, &attribute, &value ) == FAILURE)
{
RETURN_THROWS();
Expand Down
3 changes: 1 addition & 2 deletions ext/intl/php_intl.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,7 @@ function numfmt_format_currency(NumberFormatter $fmt, float $value, string $curr
*/
function numfmt_parse_currency(NumberFormatter $fmt, string $value, &$currency, &$position = null): float|false {}

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

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

Expand Down
4 changes: 2 additions & 2 deletions ext/intl/php_intl_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 9284fbafde8c7430a30a8fff5537bf9e6d9c6125 */
* Stub hash: fdc7c500ddc5bc560ec54b7ce12d5961a4697a63 */

ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_intlcal_create_instance, 0, 0, IntlCalendar, 1)
ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, timeZone, "null")
Expand Down Expand Up @@ -402,7 +402,7 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_numfmt_set_attribute, 0, 3, _IS_BOOL, 0)
ZEND_ARG_OBJ_INFO(0, fmt, NumberFormatter, 0)
ZEND_ARG_TYPE_INFO(0, attr, IS_LONG, 0)
ZEND_ARG_INFO(0, value)
ZEND_ARG_TYPE_MASK(0, value, MAY_BE_LONG|MAY_BE_DOUBLE, NULL)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_numfmt_get_attribute, 0, 2, MAY_BE_LONG|MAY_BE_DOUBLE|MAY_BE_FALSE)
Expand Down
43 changes: 26 additions & 17 deletions ext/ldap/ldap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1423,7 +1423,9 @@ static void php_set_opts(LDAP *ldap, int sizelimit, int timelimit, int deref, in
/* {{{ php_ldap_do_search */
static void php_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope)
{
zval *link, *base_dn, *filter, *attrs = NULL, *attr, *serverctrls = NULL;
zval *link, *attrs = NULL, *attr, *serverctrls = NULL;
zend_string *base_dn_str, *filter_str;
HashTable *base_dn_ht, *filter_ht;
zend_long attrsonly, sizelimit, timelimit, deref;
zend_string *ldap_filter = NULL, *ldap_base_dn = NULL;
char **ldap_attrs = NULL;
Expand All @@ -1434,10 +1436,17 @@ static void php_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope)
int old_ldap_sizelimit = -1, old_ldap_timelimit = -1, old_ldap_deref = -1;
int num_attribs = 0, ret = 1, i, errno, argcount = ZEND_NUM_ARGS();

if (zend_parse_parameters(argcount, "zzz|a/lllla/", &link, &base_dn, &filter, &attrs, &attrsonly,
&sizelimit, &timelimit, &deref, &serverctrls) == FAILURE) {
RETURN_THROWS();
}
ZEND_PARSE_PARAMETERS_START(3, 9)
Z_PARAM_ZVAL(link)
Z_PARAM_STR_OR_ARRAY_HT(base_dn_str, base_dn_ht)
Z_PARAM_STR_OR_ARRAY_HT(filter_str, filter_ht)
Z_PARAM_OPTIONAL
Z_PARAM_ARRAY_EX(attrs, 0, 1)
Z_PARAM_LONG(attrsonly)
Z_PARAM_LONG(sizelimit)
Z_PARAM_LONG(timelimit)
Z_PARAM_ARRAY_EX(serverctrls, 0, 1)
ZEND_PARSE_PARAMETERS_END();

/* Reverse -> fall through */
switch (argcount) {
Expand Down Expand Up @@ -1486,34 +1495,34 @@ static void php_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope)
goto cleanup;
}

if (Z_TYPE_P(base_dn) == IS_ARRAY) {
nbases = zend_hash_num_elements(Z_ARRVAL_P(base_dn));
if (base_dn_ht) {
nbases = zend_hash_num_elements(base_dn_ht);
if (nbases != nlinks) {
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");
ret = 0;
goto cleanup;
}
zend_hash_internal_pointer_reset(Z_ARRVAL_P(base_dn));
zend_hash_internal_pointer_reset(base_dn_ht);
} else {
nbases = 0; /* this means string, not array */
ldap_base_dn = zval_get_string(base_dn);
ldap_base_dn = zend_string_copy(base_dn_str);
if (EG(exception)) {
ret = 0;
goto cleanup;
}
}

if (Z_TYPE_P(filter) == IS_ARRAY) {
nfilters = zend_hash_num_elements(Z_ARRVAL_P(filter));
if (filter_ht) {
nfilters = zend_hash_num_elements(filter_ht);
if (nfilters != nlinks) {
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");
ret = 0;
goto cleanup;
}
zend_hash_internal_pointer_reset(Z_ARRVAL_P(filter));
zend_hash_internal_pointer_reset(filter_ht);
} else {
nfilters = 0; /* this means string, not array */
ldap_filter = zval_get_string(filter);
ldap_filter = zend_string_copy(filter_str);
if (EG(exception)) {
ret = 0;
goto cleanup;
Expand All @@ -1533,17 +1542,17 @@ static void php_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope)
goto cleanup_parallel;
}
if (nbases != 0) { /* base_dn an array? */
entry = zend_hash_get_current_data(Z_ARRVAL_P(base_dn));
zend_hash_move_forward(Z_ARRVAL_P(base_dn));
entry = zend_hash_get_current_data(base_dn_ht);
zend_hash_move_forward(base_dn_ht);
ldap_base_dn = zval_get_string(entry);
if (EG(exception)) {
ret = 0;
goto cleanup_parallel;
}
}
if (nfilters != 0) { /* filter an array? */
entry = zend_hash_get_current_data(Z_ARRVAL_P(filter));
zend_hash_move_forward(Z_ARRVAL_P(filter));
entry = zend_hash_get_current_data(filter_ht);
zend_hash_move_forward(filter_ht);
ldap_filter = zval_get_string(entry);
if (EG(exception)) {
ret = 0;
Expand Down
12 changes: 3 additions & 9 deletions ext/ldap/ldap.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,21 @@ function ldap_sasl_bind($link, string $binddn = UNKNOWN, string $password = UNKN

/**
* @param resource|array $link_identifier
* @param string|array $base_dn
* @param string|array $filter
* @return resource|false
*/
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 = []) {}
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 = []) {}

/**
* @param resource|array $link_identifier
* @param string|array $base_dn
* @param string|array $filter
* @return resource|false
*/
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 = []) {}
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 = []) {}

/**
* @param resource|array $link_identifier
* @param string|array $base_dn
* @param string|array $filter
* @return resource|false
*/
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 = []) {}
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 = []) {}

/** @param resource $link_identifier */
function ldap_free_result($link_identifier): bool {}
Expand Down
6 changes: 3 additions & 3 deletions ext/ldap/ldap_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 6b5e8ddfbdc436fab3a263d6922146ca7c2f3845 */
* Stub hash: c247d438a69d40353a629b09c5200d33ed8218ee */

#if defined(HAVE_ORALDAP)
ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_connect, 0, 0, 0)
Expand Down Expand Up @@ -52,8 +52,8 @@ ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_read, 0, 0, 3)
ZEND_ARG_INFO(0, link_identifier)
ZEND_ARG_INFO(0, base_dn)
ZEND_ARG_INFO(0, filter)
ZEND_ARG_TYPE_MASK(0, base_dn, MAY_BE_ARRAY|MAY_BE_STRING, NULL)
ZEND_ARG_TYPE_MASK(0, filter, MAY_BE_ARRAY|MAY_BE_STRING, NULL)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, attributes, IS_ARRAY, 0, "[]")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, attrsonly, IS_LONG, 0, "0")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, sizelimit, IS_LONG, 0, "-1")
Expand Down
2 changes: 1 addition & 1 deletion ext/pcre/tests/preg_replace_error1.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ string(1) "a"

Arg value is /[a-zA-Z]/
string(1) "1"
preg_replace(): Argument #1 ($regex) must be of type string|array, stdClass given
preg_replace(): Argument #1 ($regex) must be of type array|string, stdClass given
2 changes: 1 addition & 1 deletion ext/pcre/tests/preg_replace_error2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ string(64) "this is a stringthis is a stringthis is a stringthis is a string"

Arg value is: Array
preg_replace(): Argument #1 ($regex) must be of type array when argument #2 ($replace) is an array, string given
preg_replace(): Argument #2 ($replace) must be of type string|array, stdClass given
preg_replace(): Argument #2 ($replace) must be of type array|string, stdClass given
Done
2 changes: 1 addition & 1 deletion ext/phar/tests/phar_extract.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ string(2) "hi"
string(3) "hi3"
string(3) "hi2"
bool(false)
Phar::extractTo(): Argument #2 ($files) must be of type string|array|null, stdClass given
Phar::extractTo(): Argument #2 ($files) must be of type array|string|null, stdClass given
Phar::extractTo(): Argument #1 ($pathto) must be a valid path, array given
Invalid argument, extraction path must be non-zero length
Unable to use path "%soops" for extraction, it is a file, must be a directory
Expand Down
59 changes: 30 additions & 29 deletions ext/snmp/snmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -659,8 +659,10 @@ static void php_snmp_internal(INTERNAL_FUNCTION_PARAMETERS, int st,
* OID parser (and type, value for SNMP_SET command)
*/

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)
{
static int php_snmp_parse_oid(
zval *object, int st, struct objid_query *objid_query, zend_string *oid_str, HashTable *oid_ht,
zend_string *type_str, HashTable *type_ht, zend_string *value_str, HashTable *value_ht
) {
char *pptr;
uint32_t idx_type = 0, idx_value = 0;
zval *tmp_oid, *tmp_type, *tmp_value;
Expand All @@ -671,15 +673,15 @@ static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_qu
objid_query->vars = (snmpobjarg *)emalloc(sizeof(snmpobjarg));
objid_query->vars[objid_query->count].oid = ZSTR_VAL(oid_str);
if (st & SNMP_CMD_SET) {
if (Z_TYPE_P(type) == IS_STRING && Z_TYPE_P(value) == IS_STRING) {
if (Z_STRLEN_P(type) != 1) {
php_error_docref(NULL, E_WARNING, "Bogus type '%s', should be single char, got %zu", Z_STRVAL_P(type), Z_STRLEN_P(type));
if (type_str && value_str) {
if (ZSTR_LEN(type_str) != 1) {
php_error_docref(NULL, E_WARNING, "Bogus type '%s', should be single char, got %zu", ZSTR_VAL(type_str), ZSTR_LEN(type_str));
efree(objid_query->vars);
return FALSE;
}
pptr = Z_STRVAL_P(type);
pptr = ZSTR_VAL(type_str);
objid_query->vars[objid_query->count].type = *pptr;
objid_query->vars[objid_query->count].value = Z_STRVAL_P(value);
objid_query->vars[objid_query->count].value = ZSTR_VAL(value_str);
} else {
php_error_docref(NULL, E_WARNING, "Single objid and multiple type or values are not supported");
efree(objid_query->vars);
Expand All @@ -698,18 +700,18 @@ static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_qu
convert_to_string_ex(tmp_oid);
objid_query->vars[objid_query->count].oid = Z_STRVAL_P(tmp_oid);
if (st & SNMP_CMD_SET) {
if (Z_TYPE_P(type) == IS_STRING) {
pptr = Z_STRVAL_P(type);
if (type_str) {
pptr = ZSTR_VAL(type_str);
objid_query->vars[objid_query->count].type = *pptr;
} else if (Z_TYPE_P(type) == IS_ARRAY) {
while (idx_type < Z_ARRVAL_P(type)->nNumUsed) {
tmp_type = &Z_ARRVAL_P(type)->arData[idx_type].val;
} else if (type_ht) {
while (idx_type < type_ht->nNumUsed) {
tmp_type = &type_ht->arData[idx_type].val;
if (Z_TYPE_P(tmp_type) != IS_UNDEF) {
break;
}
idx_type++;
}
if (idx_type < Z_ARRVAL_P(type)->nNumUsed) {
if (idx_type < type_ht->nNumUsed) {
convert_to_string_ex(tmp_type);
if (Z_STRLEN_P(tmp_type) != 1) {
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));
Expand All @@ -726,17 +728,17 @@ static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_qu
}
}

if (Z_TYPE_P(value) == IS_STRING) {
objid_query->vars[objid_query->count].value = Z_STRVAL_P(value);
} else if (Z_TYPE_P(value) == IS_ARRAY) {
while (idx_value < Z_ARRVAL_P(value)->nNumUsed) {
tmp_value = &Z_ARRVAL_P(value)->arData[idx_value].val;
if (value_str) {
objid_query->vars[objid_query->count].value = ZSTR_VAL(value_str);
} else if (value_ht) {
while (idx_value < value_ht->nNumUsed) {
tmp_value = &value_ht->arData[idx_value].val;
if (Z_TYPE_P(tmp_value) != IS_UNDEF) {
break;
}
idx_value++;
}
if (idx_value < Z_ARRVAL_P(value)->nNumUsed) {
if (idx_value < value_ht->nNumUsed) {
convert_to_string_ex(tmp_value);
objid_query->vars[objid_query->count].value = Z_STRVAL_P(tmp_value);
idx_value++;
Expand Down Expand Up @@ -1077,9 +1079,8 @@ static int netsnmp_session_set_security(struct snmp_session *session, char *sec_
*/
static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version)
{
zend_string *oid_str;
HashTable *oid_ht;
zval *value = NULL, *type = NULL;
zend_string *oid_str, *type_str = NULL, *value_str = NULL;
HashTable *oid_ht, *type_ht = NULL, *value_ht = NULL;
char *a1, *a2, *a3, *a4, *a5, *a6, *a7;
size_t a1_len, a2_len, a3_len, a4_len, a5_len, a6_len, a7_len;
zend_bool use_orignames = 0, suffix_keys = 0;
Expand Down Expand Up @@ -1109,8 +1110,8 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version)
Z_PARAM_STRING(a6, a6_len)
Z_PARAM_STRING(a7, a7_len)
Z_PARAM_STR_OR_ARRAY_HT(oid_str, oid_ht)
Z_PARAM_ZVAL(type)
Z_PARAM_ZVAL(value)
Z_PARAM_STR_OR_ARRAY_HT(type_str, type_ht)
Z_PARAM_STR_OR_ARRAY_HT(value_str, value_ht)
Z_PARAM_OPTIONAL
Z_PARAM_LONG(timeout)
Z_PARAM_LONG(retries)
Expand Down Expand Up @@ -1140,8 +1141,8 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version)
Z_PARAM_STRING(a1, a1_len)
Z_PARAM_STRING(a2, a2_len)
Z_PARAM_STR_OR_ARRAY_HT(oid_str, oid_ht)
Z_PARAM_ZVAL(type)
Z_PARAM_ZVAL(value)
Z_PARAM_STR_OR_ARRAY_HT(type_str, type_ht)
Z_PARAM_STR_OR_ARRAY_HT(value_str, value_ht)
Z_PARAM_OPTIONAL
Z_PARAM_LONG(timeout)
Z_PARAM_LONG(retries)
Expand All @@ -1165,8 +1166,8 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version)
if (st & SNMP_CMD_SET) {
ZEND_PARSE_PARAMETERS_START(3, 3)
Z_PARAM_STR_OR_ARRAY_HT(oid_str, oid_ht)
Z_PARAM_ZVAL(type)
Z_PARAM_ZVAL(value)
Z_PARAM_STR_OR_ARRAY_HT(type_str, type_ht)
Z_PARAM_STR_OR_ARRAY_HT(value_str, value_ht)
ZEND_PARSE_PARAMETERS_END();
} else if (st & SNMP_CMD_WALK) {
ZEND_PARSE_PARAMETERS_START(1, 4)
Expand Down Expand Up @@ -1197,7 +1198,7 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version)
}
}

if (!php_snmp_parse_oid(getThis(), st, &objid_query, oid_str, oid_ht, type, value)) {
if (!php_snmp_parse_oid(getThis(), st, &objid_query, oid_str, oid_ht, type_str, type_ht, value_str, value_ht)) {
RETURN_FALSE;
}

Expand Down
Loading