@@ -1223,14 +1223,14 @@ static zend_always_inline zval *zend_try_array_init(zval *zv)
1223
1223
_(Z_EXPECTED_DOUBLE_OR_NULL, "of type ?float") \
1224
1224
_(Z_EXPECTED_NUMBER, "of type int|float") \
1225
1225
_(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") \
1228
1228
_(Z_EXPECTED_STRING_OR_LONG, "of type string|int") \
1229
1229
_(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") \
1234
1234
1235
1235
#define Z_EXPECTED_TYPE
1236
1236
@@ -1248,8 +1248,8 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_error(int error_code,
1248
1248
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_type_error (uint32_t num , zend_expected_type expected_type , zval * arg );
1249
1249
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_error (uint32_t num , const char * name , zval * arg );
1250
1250
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 );
1253
1253
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error (uint32_t num , char * error );
1254
1254
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_unexpected_extra_named_error (void );
1255
1255
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 *
1263
1263
#define ZPP_ERROR_WRONG_CLASS_OR_NULL 4
1264
1264
#define ZPP_ERROR_WRONG_ARG 5
1265
1265
#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
1268
1268
#define ZPP_ERROR_UNEXPECTED_EXTRA_NAMED 9
1269
1269
1270
1270
#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 *
1424
1424
#define Z_PARAM_CLASS_OR_NULL (dest ) \
1425
1425
Z_PARAM_CLASS_EX(dest, 1, 0)
1426
1426
1427
- #define Z_PARAM_CLASS_NAME_OR_OBJ_EX (dest , allow_null ) \
1427
+ #define Z_PARAM_OBJ_OR_CLASS_NAME_EX (dest , allow_null ) \
1428
1428
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 ; \
1431
1431
_error_code = ZPP_ERROR_WRONG_ARG; \
1432
1432
break; \
1433
1433
}
1434
1434
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);
1437
1437
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);
1440
1440
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 ) \
1442
1442
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 ; \
1445
1445
_error_code = ZPP_ERROR_WRONG_ARG; \
1446
1446
break; \
1447
1447
}
1448
1448
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);
1451
1451
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_NULL ( destination_object , destination_string ) \
1453
+ Z_PARAM_OBJ_OR_STR_EX(destination_object, destination_string , 1);
1454
1454
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 ) \
1456
1456
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))) { \
1458
1458
if (base_ce) { \
1459
1459
_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 ; \
1461
1461
break; \
1462
1462
} 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 ; \
1464
1464
_error_code = ZPP_ERROR_WRONG_ARG; \
1465
1465
break; \
1466
1466
} \
1467
1467
}
1468
1468
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);
1471
1471
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);
1474
1474
1475
1475
/* old "d" */
1476
1476
#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 *
1779
1779
} \
1780
1780
} while (0);
1781
1781
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 ) \
1783
1783
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 ; \
1786
1786
_error_code = ZPP_ERROR_WRONG_ARG; \
1787
1787
break; \
1788
1788
}
1789
1789
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);
1792
1792
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);
1795
1795
1796
1796
#define Z_PARAM_STR_OR_LONG_EX (dest_str , dest_long , is_null , allow_null ) \
1797
1797
Z_PARAM_PROLOGUE(0, 0); \
@@ -2058,12 +2058,12 @@ static zend_always_inline void zend_parse_arg_zval_deref(zval *arg, zval **dest,
2058
2058
* dest = (check_null && UNEXPECTED (Z_TYPE_P (arg ) == IS_NULL )) ? NULL : arg ;
2059
2059
}
2060
2060
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 )
2063
2063
{
2064
2064
if (EXPECTED (Z_TYPE_P (arg ) == IS_STRING )) {
2065
- * dest_str = Z_STR_P (arg );
2066
2065
* dest_ht = NULL ;
2066
+ * dest_str = Z_STR_P (arg );
2067
2067
} else if (EXPECTED (Z_TYPE_P (arg ) == IS_ARRAY )) {
2068
2068
* dest_ht = Z_ARRVAL_P (arg );
2069
2069
* dest_str = NULL ;
@@ -2097,7 +2097,7 @@ static zend_always_inline bool zend_parse_arg_str_or_long(zval *arg, zend_string
2097
2097
return 1 ;
2098
2098
}
2099
2099
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 (
2101
2101
zval * arg , zend_class_entry * * destination , bool allow_null
2102
2102
) {
2103
2103
if (EXPECTED (Z_TYPE_P (arg ) == IS_STRING )) {
@@ -2115,13 +2115,13 @@ static zend_always_inline bool zend_parse_arg_class_name_or_obj(
2115
2115
return 1 ;
2116
2116
}
2117
2117
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
2120
2120
) {
2121
2121
if (EXPECTED (Z_TYPE_P (arg ) == IS_OBJECT )) {
2122
2122
if (!base_ce || EXPECTED (instanceof_function (Z_OBJCE_P (arg ), base_ce ))) {
2123
- * destination_string = NULL ;
2124
2123
* destination_object = Z_OBJ_P (arg );
2124
+ * destination_string = NULL ;
2125
2125
return 1 ;
2126
2126
}
2127
2127
}
0 commit comments