Skip to content

Commit

Permalink
Consolidate new union type ZPP macro names
Browse files Browse the repository at this point in the history
They will now follow the canonical order of types. Older macros are
left intact due to maintaining BC.

Closes GH-6112
  • Loading branch information
kocsismate committed Sep 11, 2020
1 parent a59923b commit c98d476
Show file tree
Hide file tree
Showing 31 changed files with 206 additions and 206 deletions.
10 changes: 5 additions & 5 deletions Zend/tests/010.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ bool(false)
string(3) "foo"
bool(false)
bool(false)
get_parent_class(): Argument #1 ($object_or_class) must be a valid class name or object, string given
get_parent_class(): Argument #1 ($object_or_class) must be a valid class name or object, string given
get_parent_class(): Argument #1 ($object_or_class) must be a valid class name or object, string given
get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, string given
get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, string given
get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, string given
bool(false)
get_parent_class(): Argument #1 ($object_or_class) must be a valid class name or object, array given
get_parent_class(): Argument #1 ($object_or_class) must be a valid class name or object, int given
get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, array given
get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, int given
Done
2 changes: 1 addition & 1 deletion Zend/tests/str_or_obj_of_class_zpp.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Test Z_PARAM_STR_OR_OBJ_OF_CLASS() and Z_PARAM_STR_OR_OBJ_OF_CLASS_OR_NULL
Test Z_PARAM_OBJ_OF_CLASS_OR_STR() and Z_PARAM_OBJ_OF_CLASS_OR_STR_OR_NULL
--SKIPIF--
<?php
if (!extension_loaded('zend-test')) die('skip zend-test extension not loaded');
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/str_or_obj_zpp.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Test Z_PARAM_STR_OR_OBJ() and Z_PARAM_STR_OR_OBJ_OR_NULL
Test Z_PARAM_OBJ_OR_STR() and Z_PARAM_OBJ_OR_STR_OR_NULL
--SKIPIF--
<?php
if (!extension_loaded('zend-test')) die('skip zend-test extension not loaded');
Expand Down
12 changes: 6 additions & 6 deletions Zend/zend_API.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,11 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_error(int error_code,
case ZPP_ERROR_WRONG_ARG:
zend_wrong_parameter_type_error(num, expected_type, arg);
break;
case ZPP_ERROR_WRONG_STRING_OR_CLASS:
zend_wrong_parameter_string_or_class_error(num, name, arg);
case ZPP_ERROR_WRONG_CLASS_OR_STRING:
zend_wrong_parameter_class_or_string_error(num, name, arg);
break;
case ZPP_ERROR_WRONG_STRING_OR_CLASS_OR_NULL:
zend_wrong_parameter_string_or_class_or_null_error(num, name, arg);
case ZPP_ERROR_WRONG_CLASS_OR_STRING_OR_NULL:
zend_wrong_parameter_class_or_string_or_null_error(num, name, arg);
break;
case ZPP_ERROR_UNEXPECTED_EXTRA_NAMED:
zend_unexpected_extra_named_error();
Expand Down Expand Up @@ -280,7 +280,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_null_error(u
}
/* }}} */

ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_string_or_class_error(uint32_t num, const char *name, zval *arg) /* {{{ */
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_string_error(uint32_t num, const char *name, zval *arg) /* {{{ */
{
if (EG(exception)) {
return;
Expand All @@ -290,7 +290,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_string_or_class_error
}
/* }}} */

ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_string_or_class_or_null_error(uint32_t num, const char *name, zval *arg) /* {{{ */
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_string_or_null_error(uint32_t num, const char *name, zval *arg) /* {{{ */
{
if (EG(exception)) {
return;
Expand Down
92 changes: 46 additions & 46 deletions Zend/zend_API.h
Original file line number Diff line number Diff line change
Expand Up @@ -1223,14 +1223,14 @@ 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 array|string") \
_(Z_EXPECTED_STRING_OR_ARRAY_OR_NULL, "of type array|string|null") \
_(Z_EXPECTED_ARRAY_OR_STRING, "of type array|string") \
_(Z_EXPECTED_ARRAY_OR_STRING_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") \
_(Z_EXPECTED_CLASS_NAME_OR_OBJECT_OR_NULL, "a valid class name, object, or null") \
_(Z_EXPECTED_STRING_OR_OBJECT, "of type object|string") \
_(Z_EXPECTED_STRING_OR_OBJECT_OR_NULL, "of type object|string|null") \
_(Z_EXPECTED_OBJECT_OR_CLASS_NAME, "an object or a valid class name") \
_(Z_EXPECTED_OBJECT_OR_CLASS_NAME_OR_NULL, "an object, a valid class name, or null") \
_(Z_EXPECTED_OBJECT_OR_STRING, "of type object|string") \
_(Z_EXPECTED_OBJECT_OR_STRING_OR_NULL, "of type object|string|null") \

#define Z_EXPECTED_TYPE

Expand All @@ -1248,8 +1248,8 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_error(int error_code,
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_type_error(uint32_t num, zend_expected_type expected_type, zval *arg);
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_error(uint32_t num, const char *name, zval *arg);
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_null_error(uint32_t num, const char *name, zval *arg);
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_string_or_class_error(uint32_t num, const char *name, zval *arg);
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_string_or_class_or_null_error(uint32_t num, const char *name, zval *arg);
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_string_error(uint32_t num, const char *name, zval *arg);
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_string_or_null_error(uint32_t num, const char *name, zval *arg);
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(uint32_t num, char *error);
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_unexpected_extra_named_error(void);
ZEND_API ZEND_COLD void zend_argument_error(zend_class_entry *error_ce, uint32_t arg_num, const char *format, ...);
Expand All @@ -1263,8 +1263,8 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *
#define ZPP_ERROR_WRONG_CLASS_OR_NULL 4
#define ZPP_ERROR_WRONG_ARG 5
#define ZPP_ERROR_WRONG_COUNT 6
#define ZPP_ERROR_WRONG_STRING_OR_CLASS 7
#define ZPP_ERROR_WRONG_STRING_OR_CLASS_OR_NULL 8
#define ZPP_ERROR_WRONG_CLASS_OR_STRING 7
#define ZPP_ERROR_WRONG_CLASS_OR_STRING_OR_NULL 8
#define ZPP_ERROR_UNEXPECTED_EXTRA_NAMED 9

#define ZEND_PARSE_PARAMETERS_START_EX(flags, min_num_args, max_num_args) do { \
Expand Down Expand Up @@ -1424,53 +1424,53 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *
#define Z_PARAM_CLASS_OR_NULL(dest) \
Z_PARAM_CLASS_EX(dest, 1, 0)

#define Z_PARAM_CLASS_NAME_OR_OBJ_EX(dest, allow_null) \
#define Z_PARAM_OBJ_OR_CLASS_NAME_EX(dest, allow_null) \
Z_PARAM_PROLOGUE(0, 0); \
if (UNEXPECTED(!zend_parse_arg_class_name_or_obj(_arg, &dest, allow_null))) { \
_expected_type = allow_null ? Z_EXPECTED_CLASS_NAME_OR_OBJECT_OR_NULL : Z_EXPECTED_CLASS_NAME_OR_OBJECT; \
if (UNEXPECTED(!zend_parse_arg_obj_or_class_name(_arg, &dest, allow_null))) { \
_expected_type = allow_null ? Z_EXPECTED_OBJECT_OR_CLASS_NAME_OR_NULL : Z_EXPECTED_OBJECT_OR_CLASS_NAME; \
_error_code = ZPP_ERROR_WRONG_ARG; \
break; \
}

#define Z_PARAM_CLASS_NAME_OR_OBJ(dest) \
Z_PARAM_CLASS_NAME_OR_OBJ_EX(dest, 0);
#define Z_PARAM_OBJ_OR_CLASS_NAME(dest) \
Z_PARAM_OBJ_OR_CLASS_NAME_EX(dest, 0);

#define Z_PARAM_CLASS_NAME_OR_OBJ_OR_NULL(dest) \
Z_PARAM_CLASS_NAME_OR_OBJ_EX(dest, 1);
#define Z_PARAM_OBJ_OR_CLASS_NAME_OR_NULL(dest) \
Z_PARAM_OBJ_OR_CLASS_NAME_EX(dest, 1);

#define Z_PARAM_STR_OR_OBJ_EX(destination_string, destination_object, allow_null) \
#define Z_PARAM_OBJ_OR_STR_EX(destination_object, destination_string, allow_null) \
Z_PARAM_PROLOGUE(0, 0); \
if (UNEXPECTED(!zend_parse_arg_str_or_obj(_arg, &destination_string, &destination_object, NULL, allow_null))) { \
_expected_type = allow_null ? Z_EXPECTED_STRING_OR_OBJECT_OR_NULL : Z_EXPECTED_STRING_OR_OBJECT; \
if (UNEXPECTED(!zend_parse_arg_obj_or_str(_arg, &destination_object, NULL, &destination_string, allow_null))) { \
_expected_type = allow_null ? Z_EXPECTED_OBJECT_OR_STRING_OR_NULL : Z_EXPECTED_OBJECT_OR_STRING; \
_error_code = ZPP_ERROR_WRONG_ARG; \
break; \
}

#define Z_PARAM_STR_OR_OBJ(destination_string, destination_object) \
Z_PARAM_STR_OR_OBJ_EX(destination_string, destination_object, 0);
#define Z_PARAM_OBJ_OR_STR(destination_object, destination_string) \
Z_PARAM_OBJ_OR_STR_EX(destination_object, destination_string, 0);

#define Z_PARAM_STR_OR_OBJ_OR_NULL(destination_string, destination_object) \
Z_PARAM_STR_OR_OBJ_EX(destination_string, destination_object, 1);
#define Z_PARAM_OBJ_OR_STR_OR_NULL(destination_object, destination_string) \
Z_PARAM_OBJ_OR_STR_EX(destination_object, destination_string, 1);

#define Z_PARAM_STR_OR_OBJ_OF_CLASS_EX(destination_string, destination_object, base_ce, allow_null) \
#define Z_PARAM_OBJ_OF_CLASS_OR_STR_EX(destination_object, base_ce, destination_string, allow_null) \
Z_PARAM_PROLOGUE(0, 0); \
if (UNEXPECTED(!zend_parse_arg_str_or_obj(_arg, &destination_string, &destination_object, base_ce, allow_null))) { \
if (UNEXPECTED(!zend_parse_arg_obj_or_str(_arg, &destination_object, base_ce, &destination_string, allow_null))) { \
if (base_ce) { \
_error = ZSTR_VAL((base_ce)->name); \
_error_code = allow_null ? ZPP_ERROR_WRONG_STRING_OR_CLASS_OR_NULL : ZPP_ERROR_WRONG_STRING_OR_CLASS; \
_error_code = allow_null ? ZPP_ERROR_WRONG_CLASS_OR_STRING_OR_NULL : ZPP_ERROR_WRONG_CLASS_OR_STRING; \
break; \
} else { \
_expected_type = allow_null ? Z_EXPECTED_STRING_OR_OBJECT_OR_NULL : Z_EXPECTED_STRING_OR_OBJECT; \
_expected_type = allow_null ? Z_EXPECTED_OBJECT_OR_STRING_OR_NULL : Z_EXPECTED_OBJECT_OR_STRING; \
_error_code = ZPP_ERROR_WRONG_ARG; \
break; \
} \
}

#define Z_PARAM_STR_OR_OBJ_OF_CLASS(destination_string, destination_object, base_ce) \
Z_PARAM_STR_OR_OBJ_OF_CLASS_EX(destination_string, destination_object, base_ce, 0);
#define Z_PARAM_OBJ_OF_CLASS_OR_STR(destination_object, base_ce, destination_string) \
Z_PARAM_OBJ_OF_CLASS_OR_STR_EX(destination_object, base_ce, destination_string, 0);

#define Z_PARAM_STR_OR_OBJ_OF_CLASS_OR_NULL(destination_string, destination_object, base_ce) \
Z_PARAM_STR_OR_OBJ_OF_CLASS_EX(destination_string, destination_object, base_ce, 1);
#define Z_PARAM_OBJ_OF_CLASS_OR_STR_OR_NULL(destination_object, base_ce, destination_string) \
Z_PARAM_OBJ_OF_CLASS_OR_STR_EX(destination_object, base_ce, destination_string, 1);

/* old "d" */
#define Z_PARAM_DOUBLE_EX2(dest, is_null, check_null, deref, separate) \
Expand Down Expand Up @@ -1779,19 +1779,19 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *
} \
} while (0);

#define Z_PARAM_STR_OR_ARRAY_HT_EX(dest_str, dest_ht, allow_null) \
#define Z_PARAM_ARRAY_HT_OR_STR_EX(dest_ht, dest_str, allow_null) \
Z_PARAM_PROLOGUE(0, 0); \
if (UNEXPECTED(!zend_parse_arg_str_or_array_ht(_arg, &dest_str, &dest_ht, allow_null))) { \
_expected_type = allow_null ? Z_EXPECTED_STRING_OR_ARRAY_OR_NULL : Z_EXPECTED_STRING_OR_ARRAY; \
if (UNEXPECTED(!zend_parse_arg_array_ht_or_str(_arg, &dest_ht, &dest_str, allow_null))) { \
_expected_type = allow_null ? Z_EXPECTED_ARRAY_OR_STRING_OR_NULL : Z_EXPECTED_ARRAY_OR_STRING; \
_error_code = ZPP_ERROR_WRONG_ARG; \
break; \
}

#define Z_PARAM_STR_OR_ARRAY_HT(dest_str, dest_ht) \
Z_PARAM_STR_OR_ARRAY_HT_EX(dest_str, dest_ht, 0);
#define Z_PARAM_ARRAY_HT_OR_STR(dest_ht, dest_str) \
Z_PARAM_ARRAY_HT_OR_STR_EX(dest_ht, dest_str, 0);

#define Z_PARAM_STR_OR_ARRAY_HT_OR_NULL(dest_str, dest_ht) \
Z_PARAM_STR_OR_ARRAY_HT_EX(dest_str, dest_ht, 1);
#define Z_PARAM_ARRAY_HT_OR_STR_OR_NULL(dest_ht, dest_str) \
Z_PARAM_ARRAY_HT_OR_STR_EX(dest_ht, dest_str, 1);

#define Z_PARAM_STR_OR_LONG_EX(dest_str, dest_long, is_null, allow_null) \
Z_PARAM_PROLOGUE(0, 0); \
Expand Down Expand Up @@ -2058,12 +2058,12 @@ static zend_always_inline void zend_parse_arg_zval_deref(zval *arg, zval **dest,
*dest = (check_null && UNEXPECTED(Z_TYPE_P(arg) == IS_NULL)) ? NULL : arg;
}

static zend_always_inline bool zend_parse_arg_str_or_array_ht(
zval *arg, zend_string **dest_str, HashTable **dest_ht, bool allow_null)
static zend_always_inline bool zend_parse_arg_array_ht_or_str(
zval *arg, HashTable **dest_ht, zend_string **dest_str, bool allow_null)
{
if (EXPECTED(Z_TYPE_P(arg) == IS_STRING)) {
*dest_str = Z_STR_P(arg);
*dest_ht = NULL;
*dest_str = Z_STR_P(arg);
} else if (EXPECTED(Z_TYPE_P(arg) == IS_ARRAY)) {
*dest_ht = Z_ARRVAL_P(arg);
*dest_str = NULL;
Expand Down Expand Up @@ -2097,7 +2097,7 @@ static zend_always_inline bool zend_parse_arg_str_or_long(zval *arg, zend_string
return 1;
}

static zend_always_inline bool zend_parse_arg_class_name_or_obj(
static zend_always_inline bool zend_parse_arg_obj_or_class_name(
zval *arg, zend_class_entry **destination, bool allow_null
) {
if (EXPECTED(Z_TYPE_P(arg) == IS_STRING)) {
Expand All @@ -2115,13 +2115,13 @@ static zend_always_inline bool zend_parse_arg_class_name_or_obj(
return 1;
}

static zend_always_inline bool zend_parse_arg_str_or_obj(
zval *arg, zend_string **destination_string, zend_object **destination_object, zend_class_entry *base_ce, bool allow_null
static zend_always_inline bool zend_parse_arg_obj_or_str(
zval *arg, zend_object **destination_object, zend_class_entry *base_ce, zend_string **destination_string, bool allow_null
) {
if (EXPECTED(Z_TYPE_P(arg) == IS_OBJECT)) {
if (!base_ce || EXPECTED(instanceof_function(Z_OBJCE_P(arg), base_ce))) {
*destination_string = NULL;
*destination_object = Z_OBJ_P(arg);
*destination_string = NULL;
return 1;
}
}
Expand Down
4 changes: 2 additions & 2 deletions Zend/zend_builtin_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ ZEND_FUNCTION(get_parent_class)

ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
Z_PARAM_CLASS_NAME_OR_OBJ(ce)
Z_PARAM_OBJ_OR_CLASS_NAME(ce)
ZEND_PARSE_PARAMETERS_END();

if (!ce) {
Expand Down Expand Up @@ -892,7 +892,7 @@ ZEND_FUNCTION(get_class_methods)
zend_function *mptr;

ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_CLASS_NAME_OR_OBJ(ce)
Z_PARAM_OBJ_OR_CLASS_NAME(ce)
ZEND_PARSE_PARAMETERS_END();

array_init(return_value);
Expand Down
4 changes: 2 additions & 2 deletions ext/com_dotnet/com_com.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ PHP_METHOD(com, __construct)
ZEND_PARSE_PARAMETERS_START(1, 4)
Z_PARAM_STRING(module_name, module_name_len)
Z_PARAM_OPTIONAL
Z_PARAM_STR_OR_ARRAY_HT_OR_NULL(server_name, server_params)
Z_PARAM_ARRAY_HT_OR_STR_OR_NULL(server_params, server_name)
Z_PARAM_LONG(cp)
Z_PARAM_STRING(typelib_name, typelib_name_len)
ZEND_PARSE_PARAMETERS_END();
Expand Down Expand Up @@ -695,7 +695,7 @@ PHP_FUNCTION(com_event_sink)
Z_PARAM_OBJECT_OF_CLASS(object, php_com_variant_class_entry)
Z_PARAM_OBJECT(sinkobject)
Z_PARAM_OPTIONAL
Z_PARAM_STR_OR_ARRAY_HT_OR_NULL(sink_str, sink_ht)
Z_PARAM_ARRAY_HT_OR_STR_OR_NULL(sink_ht, sink_str)
ZEND_PARSE_PARAMETERS_END();

RETVAL_FALSE;
Expand Down
2 changes: 1 addition & 1 deletion ext/dom/xpath.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ PHP_METHOD(DOMXPath, registerPhpFunctions)

ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
Z_PARAM_STR_OR_ARRAY_HT_OR_NULL(name, ht)
Z_PARAM_ARRAY_HT_OR_STR_OR_NULL(ht, name)
ZEND_PARSE_PARAMETERS_END();

if (ht) {
Expand Down
4 changes: 2 additions & 2 deletions ext/ffi/ffi.c
Original file line number Diff line number Diff line change
Expand Up @@ -3601,7 +3601,7 @@ ZEND_METHOD(FFI, new) /* {{{ */

ZEND_FFI_VALIDATE_API_RESTRICTION();
ZEND_PARSE_PARAMETERS_START(1, 3)
Z_PARAM_STR_OR_OBJ_OF_CLASS(type_def, type_obj, zend_ffi_ctype_ce)
Z_PARAM_OBJ_OF_CLASS_OR_STR(type_obj, zend_ffi_ctype_ce, type_def)
Z_PARAM_OPTIONAL
Z_PARAM_BOOL(owned)
Z_PARAM_BOOL(persistent)
Expand Down Expand Up @@ -3752,7 +3752,7 @@ ZEND_METHOD(FFI, cast) /* {{{ */

ZEND_FFI_VALIDATE_API_RESTRICTION();
ZEND_PARSE_PARAMETERS_START(2, 2)
Z_PARAM_STR_OR_OBJ_OF_CLASS(type_def, ztype, zend_ffi_ctype_ce)
Z_PARAM_OBJ_OF_CLASS_OR_STR(ztype, zend_ffi_ctype_ce, type_def)
Z_PARAM_ZVAL(zv)
ZEND_PARSE_PARAMETERS_END();

Expand Down
2 changes: 1 addition & 1 deletion ext/intl/calendar/calendar_methods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ U_CFUNC PHP_FUNCTION(intlcal_from_date_time)
intl_error_reset(NULL);

ZEND_PARSE_PARAMETERS_START(1, 2)
Z_PARAM_STR_OR_OBJ_OF_CLASS(date_str, date_obj, php_date_get_date_ce())
Z_PARAM_OBJ_OF_CLASS_OR_STR(date_obj, php_date_get_date_ce(), date_str)
Z_PARAM_OPTIONAL
Z_PARAM_STRING_OR_NULL(locale_str, locale_str_len)
ZEND_PARSE_PARAMETERS_END();
Expand Down
2 changes: 1 addition & 1 deletion ext/intl/transliterator/transliterator_methods.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ PHP_FUNCTION( transliterator_transliterate )
zend_object *arg1_obj;

ZEND_PARSE_PARAMETERS_START(2, 4)
Z_PARAM_STR_OR_OBJ_OF_CLASS(arg1_str, arg1_obj, Transliterator_ce_ptr)
Z_PARAM_OBJ_OF_CLASS_OR_STR(arg1_obj, Transliterator_ce_ptr, arg1_str)
Z_PARAM_STRING(str, str_len)
Z_PARAM_OPTIONAL
Z_PARAM_LONG(start)
Expand Down
4 changes: 2 additions & 2 deletions ext/ldap/ldap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1438,8 +1438,8 @@ static void php_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope)

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_ARRAY_HT_OR_STR(base_dn_ht, base_dn_str)
Z_PARAM_ARRAY_HT_OR_STR(filter_ht, filter_str)
Z_PARAM_OPTIONAL
Z_PARAM_ARRAY_EX(attrs, 0, 1)
Z_PARAM_LONG(attrsonly)
Expand Down

0 comments on commit c98d476

Please sign in to comment.