Skip to content

Commit c98d476

Browse files
committed
Consolidate new union type ZPP macro names
They will now follow the canonical order of types. Older macros are left intact due to maintaining BC. Closes GH-6112
1 parent a59923b commit c98d476

31 files changed

+206
-206
lines changed

Zend/tests/010.phpt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ bool(false)
7575
string(3) "foo"
7676
bool(false)
7777
bool(false)
78-
get_parent_class(): Argument #1 ($object_or_class) must be a valid class name or object, string given
79-
get_parent_class(): Argument #1 ($object_or_class) must be a valid class name or object, string given
80-
get_parent_class(): Argument #1 ($object_or_class) must be a valid class name or object, string given
78+
get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, string given
79+
get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, string given
80+
get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, string given
8181
bool(false)
82-
get_parent_class(): Argument #1 ($object_or_class) must be a valid class name or object, array given
83-
get_parent_class(): Argument #1 ($object_or_class) must be a valid class name or object, int given
82+
get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, array given
83+
get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, int given
8484
Done

Zend/tests/str_or_obj_of_class_zpp.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
--TEST--
2-
Test Z_PARAM_STR_OR_OBJ_OF_CLASS() and Z_PARAM_STR_OR_OBJ_OF_CLASS_OR_NULL
2+
Test Z_PARAM_OBJ_OF_CLASS_OR_STR() and Z_PARAM_OBJ_OF_CLASS_OR_STR_OR_NULL
33
--SKIPIF--
44
<?php
55
if (!extension_loaded('zend-test')) die('skip zend-test extension not loaded');

Zend/tests/str_or_obj_zpp.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
--TEST--
2-
Test Z_PARAM_STR_OR_OBJ() and Z_PARAM_STR_OR_OBJ_OR_NULL
2+
Test Z_PARAM_OBJ_OR_STR() and Z_PARAM_OBJ_OR_STR_OR_NULL
33
--SKIPIF--
44
<?php
55
if (!extension_loaded('zend-test')) die('skip zend-test extension not loaded');

Zend/zend_API.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -224,11 +224,11 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_error(int error_code,
224224
case ZPP_ERROR_WRONG_ARG:
225225
zend_wrong_parameter_type_error(num, expected_type, arg);
226226
break;
227-
case ZPP_ERROR_WRONG_STRING_OR_CLASS:
228-
zend_wrong_parameter_string_or_class_error(num, name, arg);
227+
case ZPP_ERROR_WRONG_CLASS_OR_STRING:
228+
zend_wrong_parameter_class_or_string_error(num, name, arg);
229229
break;
230-
case ZPP_ERROR_WRONG_STRING_OR_CLASS_OR_NULL:
231-
zend_wrong_parameter_string_or_class_or_null_error(num, name, arg);
230+
case ZPP_ERROR_WRONG_CLASS_OR_STRING_OR_NULL:
231+
zend_wrong_parameter_class_or_string_or_null_error(num, name, arg);
232232
break;
233233
case ZPP_ERROR_UNEXPECTED_EXTRA_NAMED:
234234
zend_unexpected_extra_named_error();
@@ -280,7 +280,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_null_error(u
280280
}
281281
/* }}} */
282282

283-
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_string_or_class_error(uint32_t num, const char *name, zval *arg) /* {{{ */
283+
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_string_error(uint32_t num, const char *name, zval *arg) /* {{{ */
284284
{
285285
if (EG(exception)) {
286286
return;
@@ -290,7 +290,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_string_or_class_error
290290
}
291291
/* }}} */
292292

293-
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_string_or_class_or_null_error(uint32_t num, const char *name, zval *arg) /* {{{ */
293+
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_string_or_null_error(uint32_t num, const char *name, zval *arg) /* {{{ */
294294
{
295295
if (EG(exception)) {
296296
return;

Zend/zend_API.h

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,14 +1223,14 @@ static zend_always_inline zval *zend_try_array_init(zval *zv)
12231223
_(Z_EXPECTED_DOUBLE_OR_NULL, "of type ?float") \
12241224
_(Z_EXPECTED_NUMBER, "of type int|float") \
12251225
_(Z_EXPECTED_NUMBER_OR_NULL, "of type int|float|null") \
1226-
_(Z_EXPECTED_STRING_OR_ARRAY, "of type array|string") \
1227-
_(Z_EXPECTED_STRING_OR_ARRAY_OR_NULL, "of type array|string|null") \
1226+
_(Z_EXPECTED_ARRAY_OR_STRING, "of type array|string") \
1227+
_(Z_EXPECTED_ARRAY_OR_STRING_OR_NULL, "of type array|string|null") \
12281228
_(Z_EXPECTED_STRING_OR_LONG, "of type string|int") \
12291229
_(Z_EXPECTED_STRING_OR_LONG_OR_NULL, "of type string|int|null") \
1230-
_(Z_EXPECTED_CLASS_NAME_OR_OBJECT, "a valid class name or object") \
1231-
_(Z_EXPECTED_CLASS_NAME_OR_OBJECT_OR_NULL, "a valid class name, object, or null") \
1232-
_(Z_EXPECTED_STRING_OR_OBJECT, "of type object|string") \
1233-
_(Z_EXPECTED_STRING_OR_OBJECT_OR_NULL, "of type object|string|null") \
1230+
_(Z_EXPECTED_OBJECT_OR_CLASS_NAME, "an object or a valid class name") \
1231+
_(Z_EXPECTED_OBJECT_OR_CLASS_NAME_OR_NULL, "an object, a valid class name, or null") \
1232+
_(Z_EXPECTED_OBJECT_OR_STRING, "of type object|string") \
1233+
_(Z_EXPECTED_OBJECT_OR_STRING_OR_NULL, "of type object|string|null") \
12341234

12351235
#define Z_EXPECTED_TYPE
12361236

@@ -1248,8 +1248,8 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_error(int error_code,
12481248
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_type_error(uint32_t num, zend_expected_type expected_type, zval *arg);
12491249
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_error(uint32_t num, const char *name, zval *arg);
12501250
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_null_error(uint32_t num, const char *name, zval *arg);
1251-
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_string_or_class_error(uint32_t num, const char *name, zval *arg);
1252-
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_string_or_class_or_null_error(uint32_t num, const char *name, zval *arg);
1251+
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_string_error(uint32_t num, const char *name, zval *arg);
1252+
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_string_or_null_error(uint32_t num, const char *name, zval *arg);
12531253
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(uint32_t num, char *error);
12541254
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_unexpected_extra_named_error(void);
12551255
ZEND_API ZEND_COLD void zend_argument_error(zend_class_entry *error_ce, uint32_t arg_num, const char *format, ...);
@@ -1263,8 +1263,8 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *
12631263
#define ZPP_ERROR_WRONG_CLASS_OR_NULL 4
12641264
#define ZPP_ERROR_WRONG_ARG 5
12651265
#define ZPP_ERROR_WRONG_COUNT 6
1266-
#define ZPP_ERROR_WRONG_STRING_OR_CLASS 7
1267-
#define ZPP_ERROR_WRONG_STRING_OR_CLASS_OR_NULL 8
1266+
#define ZPP_ERROR_WRONG_CLASS_OR_STRING 7
1267+
#define ZPP_ERROR_WRONG_CLASS_OR_STRING_OR_NULL 8
12681268
#define ZPP_ERROR_UNEXPECTED_EXTRA_NAMED 9
12691269

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

1427-
#define Z_PARAM_CLASS_NAME_OR_OBJ_EX(dest, allow_null) \
1427+
#define Z_PARAM_OBJ_OR_CLASS_NAME_EX(dest, allow_null) \
14281428
Z_PARAM_PROLOGUE(0, 0); \
1429-
if (UNEXPECTED(!zend_parse_arg_class_name_or_obj(_arg, &dest, allow_null))) { \
1430-
_expected_type = allow_null ? Z_EXPECTED_CLASS_NAME_OR_OBJECT_OR_NULL : Z_EXPECTED_CLASS_NAME_OR_OBJECT; \
1429+
if (UNEXPECTED(!zend_parse_arg_obj_or_class_name(_arg, &dest, allow_null))) { \
1430+
_expected_type = allow_null ? Z_EXPECTED_OBJECT_OR_CLASS_NAME_OR_NULL : Z_EXPECTED_OBJECT_OR_CLASS_NAME; \
14311431
_error_code = ZPP_ERROR_WRONG_ARG; \
14321432
break; \
14331433
}
14341434

1435-
#define Z_PARAM_CLASS_NAME_OR_OBJ(dest) \
1436-
Z_PARAM_CLASS_NAME_OR_OBJ_EX(dest, 0);
1435+
#define Z_PARAM_OBJ_OR_CLASS_NAME(dest) \
1436+
Z_PARAM_OBJ_OR_CLASS_NAME_EX(dest, 0);
14371437

1438-
#define Z_PARAM_CLASS_NAME_OR_OBJ_OR_NULL(dest) \
1439-
Z_PARAM_CLASS_NAME_OR_OBJ_EX(dest, 1);
1438+
#define Z_PARAM_OBJ_OR_CLASS_NAME_OR_NULL(dest) \
1439+
Z_PARAM_OBJ_OR_CLASS_NAME_EX(dest, 1);
14401440

1441-
#define Z_PARAM_STR_OR_OBJ_EX(destination_string, destination_object, allow_null) \
1441+
#define Z_PARAM_OBJ_OR_STR_EX(destination_object, destination_string, allow_null) \
14421442
Z_PARAM_PROLOGUE(0, 0); \
1443-
if (UNEXPECTED(!zend_parse_arg_str_or_obj(_arg, &destination_string, &destination_object, NULL, allow_null))) { \
1444-
_expected_type = allow_null ? Z_EXPECTED_STRING_OR_OBJECT_OR_NULL : Z_EXPECTED_STRING_OR_OBJECT; \
1443+
if (UNEXPECTED(!zend_parse_arg_obj_or_str(_arg, &destination_object, NULL, &destination_string, allow_null))) { \
1444+
_expected_type = allow_null ? Z_EXPECTED_OBJECT_OR_STRING_OR_NULL : Z_EXPECTED_OBJECT_OR_STRING; \
14451445
_error_code = ZPP_ERROR_WRONG_ARG; \
14461446
break; \
14471447
}
14481448

1449-
#define Z_PARAM_STR_OR_OBJ(destination_string, destination_object) \
1450-
Z_PARAM_STR_OR_OBJ_EX(destination_string, destination_object, 0);
1449+
#define Z_PARAM_OBJ_OR_STR(destination_object, destination_string) \
1450+
Z_PARAM_OBJ_OR_STR_EX(destination_object, destination_string, 0);
14511451

1452-
#define Z_PARAM_STR_OR_OBJ_OR_NULL(destination_string, destination_object) \
1453-
Z_PARAM_STR_OR_OBJ_EX(destination_string, destination_object, 1);
1452+
#define Z_PARAM_OBJ_OR_STR_OR_NULL(destination_object, destination_string) \
1453+
Z_PARAM_OBJ_OR_STR_EX(destination_object, destination_string, 1);
14541454

1455-
#define Z_PARAM_STR_OR_OBJ_OF_CLASS_EX(destination_string, destination_object, base_ce, allow_null) \
1455+
#define Z_PARAM_OBJ_OF_CLASS_OR_STR_EX(destination_object, base_ce, destination_string, allow_null) \
14561456
Z_PARAM_PROLOGUE(0, 0); \
1457-
if (UNEXPECTED(!zend_parse_arg_str_or_obj(_arg, &destination_string, &destination_object, base_ce, allow_null))) { \
1457+
if (UNEXPECTED(!zend_parse_arg_obj_or_str(_arg, &destination_object, base_ce, &destination_string, allow_null))) { \
14581458
if (base_ce) { \
14591459
_error = ZSTR_VAL((base_ce)->name); \
1460-
_error_code = allow_null ? ZPP_ERROR_WRONG_STRING_OR_CLASS_OR_NULL : ZPP_ERROR_WRONG_STRING_OR_CLASS; \
1460+
_error_code = allow_null ? ZPP_ERROR_WRONG_CLASS_OR_STRING_OR_NULL : ZPP_ERROR_WRONG_CLASS_OR_STRING; \
14611461
break; \
14621462
} else { \
1463-
_expected_type = allow_null ? Z_EXPECTED_STRING_OR_OBJECT_OR_NULL : Z_EXPECTED_STRING_OR_OBJECT; \
1463+
_expected_type = allow_null ? Z_EXPECTED_OBJECT_OR_STRING_OR_NULL : Z_EXPECTED_OBJECT_OR_STRING; \
14641464
_error_code = ZPP_ERROR_WRONG_ARG; \
14651465
break; \
14661466
} \
14671467
}
14681468

1469-
#define Z_PARAM_STR_OR_OBJ_OF_CLASS(destination_string, destination_object, base_ce) \
1470-
Z_PARAM_STR_OR_OBJ_OF_CLASS_EX(destination_string, destination_object, base_ce, 0);
1469+
#define Z_PARAM_OBJ_OF_CLASS_OR_STR(destination_object, base_ce, destination_string) \
1470+
Z_PARAM_OBJ_OF_CLASS_OR_STR_EX(destination_object, base_ce, destination_string, 0);
14711471

1472-
#define Z_PARAM_STR_OR_OBJ_OF_CLASS_OR_NULL(destination_string, destination_object, base_ce) \
1473-
Z_PARAM_STR_OR_OBJ_OF_CLASS_EX(destination_string, destination_object, base_ce, 1);
1472+
#define Z_PARAM_OBJ_OF_CLASS_OR_STR_OR_NULL(destination_object, base_ce, destination_string) \
1473+
Z_PARAM_OBJ_OF_CLASS_OR_STR_EX(destination_object, base_ce, destination_string, 1);
14741474

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

1782-
#define Z_PARAM_STR_OR_ARRAY_HT_EX(dest_str, dest_ht, allow_null) \
1782+
#define Z_PARAM_ARRAY_HT_OR_STR_EX(dest_ht, dest_str, allow_null) \
17831783
Z_PARAM_PROLOGUE(0, 0); \
1784-
if (UNEXPECTED(!zend_parse_arg_str_or_array_ht(_arg, &dest_str, &dest_ht, allow_null))) { \
1785-
_expected_type = allow_null ? Z_EXPECTED_STRING_OR_ARRAY_OR_NULL : Z_EXPECTED_STRING_OR_ARRAY; \
1784+
if (UNEXPECTED(!zend_parse_arg_array_ht_or_str(_arg, &dest_ht, &dest_str, allow_null))) { \
1785+
_expected_type = allow_null ? Z_EXPECTED_ARRAY_OR_STRING_OR_NULL : Z_EXPECTED_ARRAY_OR_STRING; \
17861786
_error_code = ZPP_ERROR_WRONG_ARG; \
17871787
break; \
17881788
}
17891789

1790-
#define Z_PARAM_STR_OR_ARRAY_HT(dest_str, dest_ht) \
1791-
Z_PARAM_STR_OR_ARRAY_HT_EX(dest_str, dest_ht, 0);
1790+
#define Z_PARAM_ARRAY_HT_OR_STR(dest_ht, dest_str) \
1791+
Z_PARAM_ARRAY_HT_OR_STR_EX(dest_ht, dest_str, 0);
17921792

1793-
#define Z_PARAM_STR_OR_ARRAY_HT_OR_NULL(dest_str, dest_ht) \
1794-
Z_PARAM_STR_OR_ARRAY_HT_EX(dest_str, dest_ht, 1);
1793+
#define Z_PARAM_ARRAY_HT_OR_STR_OR_NULL(dest_ht, dest_str) \
1794+
Z_PARAM_ARRAY_HT_OR_STR_EX(dest_ht, dest_str, 1);
17951795

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

2061-
static zend_always_inline bool zend_parse_arg_str_or_array_ht(
2062-
zval *arg, zend_string **dest_str, HashTable **dest_ht, bool allow_null)
2061+
static zend_always_inline bool zend_parse_arg_array_ht_or_str(
2062+
zval *arg, HashTable **dest_ht, zend_string **dest_str, bool allow_null)
20632063
{
20642064
if (EXPECTED(Z_TYPE_P(arg) == IS_STRING)) {
2065-
*dest_str = Z_STR_P(arg);
20662065
*dest_ht = NULL;
2066+
*dest_str = Z_STR_P(arg);
20672067
} else if (EXPECTED(Z_TYPE_P(arg) == IS_ARRAY)) {
20682068
*dest_ht = Z_ARRVAL_P(arg);
20692069
*dest_str = NULL;
@@ -2097,7 +2097,7 @@ static zend_always_inline bool zend_parse_arg_str_or_long(zval *arg, zend_string
20972097
return 1;
20982098
}
20992099

2100-
static zend_always_inline bool zend_parse_arg_class_name_or_obj(
2100+
static zend_always_inline bool zend_parse_arg_obj_or_class_name(
21012101
zval *arg, zend_class_entry **destination, bool allow_null
21022102
) {
21032103
if (EXPECTED(Z_TYPE_P(arg) == IS_STRING)) {
@@ -2115,13 +2115,13 @@ static zend_always_inline bool zend_parse_arg_class_name_or_obj(
21152115
return 1;
21162116
}
21172117

2118-
static zend_always_inline bool zend_parse_arg_str_or_obj(
2119-
zval *arg, zend_string **destination_string, zend_object **destination_object, zend_class_entry *base_ce, bool allow_null
2118+
static zend_always_inline bool zend_parse_arg_obj_or_str(
2119+
zval *arg, zend_object **destination_object, zend_class_entry *base_ce, zend_string **destination_string, bool allow_null
21202120
) {
21212121
if (EXPECTED(Z_TYPE_P(arg) == IS_OBJECT)) {
21222122
if (!base_ce || EXPECTED(instanceof_function(Z_OBJCE_P(arg), base_ce))) {
2123-
*destination_string = NULL;
21242123
*destination_object = Z_OBJ_P(arg);
2124+
*destination_string = NULL;
21252125
return 1;
21262126
}
21272127
}

Zend/zend_builtin_functions.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ ZEND_FUNCTION(get_parent_class)
616616

617617
ZEND_PARSE_PARAMETERS_START(0, 1)
618618
Z_PARAM_OPTIONAL
619-
Z_PARAM_CLASS_NAME_OR_OBJ(ce)
619+
Z_PARAM_OBJ_OR_CLASS_NAME(ce)
620620
ZEND_PARSE_PARAMETERS_END();
621621

622622
if (!ce) {
@@ -892,7 +892,7 @@ ZEND_FUNCTION(get_class_methods)
892892
zend_function *mptr;
893893

894894
ZEND_PARSE_PARAMETERS_START(1, 1)
895-
Z_PARAM_CLASS_NAME_OR_OBJ(ce)
895+
Z_PARAM_OBJ_OR_CLASS_NAME(ce)
896896
ZEND_PARSE_PARAMETERS_END();
897897

898898
array_init(return_value);

ext/com_dotnet/com_com.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ PHP_METHOD(com, __construct)
5454
ZEND_PARSE_PARAMETERS_START(1, 4)
5555
Z_PARAM_STRING(module_name, module_name_len)
5656
Z_PARAM_OPTIONAL
57-
Z_PARAM_STR_OR_ARRAY_HT_OR_NULL(server_name, server_params)
57+
Z_PARAM_ARRAY_HT_OR_STR_OR_NULL(server_params, server_name)
5858
Z_PARAM_LONG(cp)
5959
Z_PARAM_STRING(typelib_name, typelib_name_len)
6060
ZEND_PARSE_PARAMETERS_END();
@@ -695,7 +695,7 @@ PHP_FUNCTION(com_event_sink)
695695
Z_PARAM_OBJECT_OF_CLASS(object, php_com_variant_class_entry)
696696
Z_PARAM_OBJECT(sinkobject)
697697
Z_PARAM_OPTIONAL
698-
Z_PARAM_STR_OR_ARRAY_HT_OR_NULL(sink_str, sink_ht)
698+
Z_PARAM_ARRAY_HT_OR_STR_OR_NULL(sink_ht, sink_str)
699699
ZEND_PARSE_PARAMETERS_END();
700700

701701
RETVAL_FALSE;

ext/dom/xpath.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ PHP_METHOD(DOMXPath, registerPhpFunctions)
500500

501501
ZEND_PARSE_PARAMETERS_START(0, 1)
502502
Z_PARAM_OPTIONAL
503-
Z_PARAM_STR_OR_ARRAY_HT_OR_NULL(name, ht)
503+
Z_PARAM_ARRAY_HT_OR_STR_OR_NULL(ht, name)
504504
ZEND_PARSE_PARAMETERS_END();
505505

506506
if (ht) {

ext/ffi/ffi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3601,7 +3601,7 @@ ZEND_METHOD(FFI, new) /* {{{ */
36013601

36023602
ZEND_FFI_VALIDATE_API_RESTRICTION();
36033603
ZEND_PARSE_PARAMETERS_START(1, 3)
3604-
Z_PARAM_STR_OR_OBJ_OF_CLASS(type_def, type_obj, zend_ffi_ctype_ce)
3604+
Z_PARAM_OBJ_OF_CLASS_OR_STR(type_obj, zend_ffi_ctype_ce, type_def)
36053605
Z_PARAM_OPTIONAL
36063606
Z_PARAM_BOOL(owned)
36073607
Z_PARAM_BOOL(persistent)
@@ -3752,7 +3752,7 @@ ZEND_METHOD(FFI, cast) /* {{{ */
37523752

37533753
ZEND_FFI_VALIDATE_API_RESTRICTION();
37543754
ZEND_PARSE_PARAMETERS_START(2, 2)
3755-
Z_PARAM_STR_OR_OBJ_OF_CLASS(type_def, ztype, zend_ffi_ctype_ce)
3755+
Z_PARAM_OBJ_OF_CLASS_OR_STR(ztype, zend_ffi_ctype_ce, type_def)
37563756
Z_PARAM_ZVAL(zv)
37573757
ZEND_PARSE_PARAMETERS_END();
37583758

ext/intl/calendar/calendar_methods.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,7 @@ U_CFUNC PHP_FUNCTION(intlcal_from_date_time)
953953
intl_error_reset(NULL);
954954

955955
ZEND_PARSE_PARAMETERS_START(1, 2)
956-
Z_PARAM_STR_OR_OBJ_OF_CLASS(date_str, date_obj, php_date_get_date_ce())
956+
Z_PARAM_OBJ_OF_CLASS_OR_STR(date_obj, php_date_get_date_ce(), date_str)
957957
Z_PARAM_OPTIONAL
958958
Z_PARAM_STRING_OR_NULL(locale_str, locale_str_len)
959959
ZEND_PARSE_PARAMETERS_END();

ext/intl/transliterator/transliterator_methods.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ PHP_FUNCTION( transliterator_transliterate )
287287
zend_object *arg1_obj;
288288

289289
ZEND_PARSE_PARAMETERS_START(2, 4)
290-
Z_PARAM_STR_OR_OBJ_OF_CLASS(arg1_str, arg1_obj, Transliterator_ce_ptr)
290+
Z_PARAM_OBJ_OF_CLASS_OR_STR(arg1_obj, Transliterator_ce_ptr, arg1_str)
291291
Z_PARAM_STRING(str, str_len)
292292
Z_PARAM_OPTIONAL
293293
Z_PARAM_LONG(start)

ext/ldap/ldap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1438,8 +1438,8 @@ static void php_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope)
14381438

14391439
ZEND_PARSE_PARAMETERS_START(3, 9)
14401440
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)
1441+
Z_PARAM_ARRAY_HT_OR_STR(base_dn_ht, base_dn_str)
1442+
Z_PARAM_ARRAY_HT_OR_STR(filter_ht, filter_str)
14431443
Z_PARAM_OPTIONAL
14441444
Z_PARAM_ARRAY_EX(attrs, 0, 1)
14451445
Z_PARAM_LONG(attrsonly)

0 commit comments

Comments
 (0)