diff options
Diffstat (limited to 'Zend/zend_API.h')
-rw-r--r-- | Zend/zend_API.h | 296 |
1 files changed, 154 insertions, 142 deletions
diff --git a/Zend/zend_API.h b/Zend/zend_API.h index 290db040b2..8072befb03 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -278,6 +278,12 @@ typedef struct _zend_fcall_info_cache { #define CE_STATIC_MEMBERS(ce) \ ((zval*)ZEND_MAP_PTR_GET((ce)->static_members_table)) +#define CE_CONSTANTS_TABLE(ce) \ + zend_class_constants_table(ce) + +#define CE_DEFAULT_PROPERTIES_TABLE(ce) \ + zend_class_default_properties_table(ce) + #define ZEND_FCI_INITIALIZED(fci) ((fci).size != 0) ZEND_API int zend_next_free_module(void); @@ -352,12 +358,12 @@ ZEND_API ZEND_COLD void zend_wrong_param_count(void); ZEND_API void zend_release_fcall_info_cache(zend_fcall_info_cache *fcc); ZEND_API zend_string *zend_get_callable_name_ex(zval *callable, zend_object *object); ZEND_API zend_string *zend_get_callable_name(zval *callable); -ZEND_API zend_bool zend_is_callable_at_frame( +ZEND_API bool zend_is_callable_at_frame( zval *callable, zend_object *object, zend_execute_data *frame, uint32_t check_flags, zend_fcall_info_cache *fcc, char **error); -ZEND_API zend_bool zend_is_callable_ex(zval *callable, zend_object *object, uint32_t check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error); -ZEND_API zend_bool zend_is_callable(zval *callable, uint32_t check_flags, zend_string **callable_name); -ZEND_API zend_bool zend_make_callable(zval *callable, zend_string **callable_name); +ZEND_API bool zend_is_callable_ex(zval *callable, zend_object *object, uint32_t check_flags, zend_string **callable_name, zend_fcall_info_cache *fcc, char **error); +ZEND_API bool zend_is_callable(zval *callable, uint32_t check_flags, zend_string **callable_name); +ZEND_API bool zend_make_callable(zval *callable, zend_string **callable_name); ZEND_API const char *zend_get_module_version(const char *module_name); ZEND_API int zend_get_module_started(const char *module_name); @@ -376,12 +382,39 @@ ZEND_API zend_class_constant *zend_declare_class_constant_ex(zend_class_entry *c ZEND_API void zend_declare_class_constant(zend_class_entry *ce, const char *name, size_t name_length, zval *value); ZEND_API void zend_declare_class_constant_null(zend_class_entry *ce, const char *name, size_t name_length); ZEND_API void zend_declare_class_constant_long(zend_class_entry *ce, const char *name, size_t name_length, zend_long value); -ZEND_API void zend_declare_class_constant_bool(zend_class_entry *ce, const char *name, size_t name_length, zend_bool value); +ZEND_API void zend_declare_class_constant_bool(zend_class_entry *ce, const char *name, size_t name_length, bool value); ZEND_API void zend_declare_class_constant_double(zend_class_entry *ce, const char *name, size_t name_length, double value); ZEND_API void zend_declare_class_constant_stringl(zend_class_entry *ce, const char *name, size_t name_length, const char *value, size_t value_length); ZEND_API void zend_declare_class_constant_string(zend_class_entry *ce, const char *name, size_t name_length, const char *value); ZEND_API zend_result zend_update_class_constants(zend_class_entry *class_type); +ZEND_API HashTable *zend_separate_class_constants_table(zend_class_entry *class_type); + +static zend_always_inline HashTable *zend_class_constants_table(zend_class_entry *ce) { + if ((ce->ce_flags & ZEND_ACC_HAS_AST_CONSTANTS) + && (ce->ce_flags & ZEND_ACC_IMMUTABLE)) { + zend_class_mutable_data *mutable_data = + (zend_class_mutable_data*)ZEND_MAP_PTR_GET_IMM(ce->mutable_data); + if (mutable_data && mutable_data->constants_table) { + return mutable_data->constants_table; + } else { + return zend_separate_class_constants_table(ce); + } + } else { + return &ce->constants_table; + } +} + +static zend_always_inline zval *zend_class_default_properties_table(zend_class_entry *ce) { + if ((ce->ce_flags & ZEND_ACC_HAS_AST_PROPERTIES) + && (ce->ce_flags & ZEND_ACC_IMMUTABLE)) { + zend_class_mutable_data *mutable_data = + (zend_class_mutable_data*)ZEND_MAP_PTR_GET_IMM(ce->mutable_data); + return mutable_data->default_properties_table; + } else { + return ce->default_properties_table; + } +} ZEND_API void zend_update_property_ex(zend_class_entry *scope, zend_object *object, zend_string *name, zval *value); ZEND_API void zend_update_property(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zval *value); @@ -403,11 +436,11 @@ ZEND_API zend_result zend_update_static_property_double(zend_class_entry *scope, ZEND_API zend_result zend_update_static_property_string(zend_class_entry *scope, const char *name, size_t name_length, const char *value); ZEND_API zend_result zend_update_static_property_stringl(zend_class_entry *scope, const char *name, size_t name_length, const char *value, size_t value_length); -ZEND_API zval *zend_read_property_ex(zend_class_entry *scope, zend_object *object, zend_string *name, zend_bool silent, zval *rv); -ZEND_API zval *zend_read_property(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, zend_bool silent, zval *rv); +ZEND_API zval *zend_read_property_ex(zend_class_entry *scope, zend_object *object, zend_string *name, bool silent, zval *rv); +ZEND_API zval *zend_read_property(zend_class_entry *scope, zend_object *object, const char *name, size_t name_length, bool silent, zval *rv); -ZEND_API zval *zend_read_static_property_ex(zend_class_entry *scope, zend_string *name, zend_bool silent); -ZEND_API zval *zend_read_static_property(zend_class_entry *scope, const char *name, size_t name_length, zend_bool silent); +ZEND_API zval *zend_read_static_property_ex(zend_class_entry *scope, zend_string *name, bool silent); +ZEND_API zval *zend_read_static_property(zend_class_entry *scope, const char *name, size_t name_length, bool silent); ZEND_API const char *zend_get_type_by_const(int type); @@ -445,6 +478,9 @@ ZEND_API void add_assoc_double_ex(zval *arg, const char *key, size_t key_len, do ZEND_API void add_assoc_str_ex(zval *arg, const char *key, size_t key_len, zend_string *str); ZEND_API void add_assoc_string_ex(zval *arg, const char *key, size_t key_len, const char *str); ZEND_API void add_assoc_stringl_ex(zval *arg, const char *key, size_t key_len, const char *str, size_t length); +ZEND_API void add_assoc_array_ex(zval *arg, const char *key, size_t key_len, zend_array *arr); +ZEND_API void add_assoc_object_ex(zval *arg, const char *key, size_t key_len, zend_object *obj); +ZEND_API void add_assoc_reference_ex(zval *arg, const char *key, size_t key_len, zend_reference *ref); ZEND_API void add_assoc_zval_ex(zval *arg, const char *key, size_t key_len, zval *value); #define add_assoc_long(__arg, __key, __n) add_assoc_long_ex(__arg, __key, strlen(__key), __n) @@ -455,6 +491,9 @@ ZEND_API void add_assoc_zval_ex(zval *arg, const char *key, size_t key_len, zval #define add_assoc_str(__arg, __key, __str) add_assoc_str_ex(__arg, __key, strlen(__key), __str) #define add_assoc_string(__arg, __key, __str) add_assoc_string_ex(__arg, __key, strlen(__key), __str) #define add_assoc_stringl(__arg, __key, __str, __length) add_assoc_stringl_ex(__arg, __key, strlen(__key), __str, __length) +#define add_assoc_array(__arg, __key, __arr) add_assoc_array_ex(__arg, __key, strlen(__key), __arr) +#define add_assoc_object(__arg, __key, __obj) add_assoc_object_ex(__arg, __key, strlen(__key), __obj) +#define add_assoc_reference(__arg, __key, __ref) add_assoc_object_ex(__arg, __key, strlen(__key), __ref) #define add_assoc_zval(__arg, __key, __value) add_assoc_zval_ex(__arg, __key, strlen(__key), __value) ZEND_API void add_index_long(zval *arg, zend_ulong index, zend_long n); @@ -465,6 +504,9 @@ ZEND_API void add_index_double(zval *arg, zend_ulong index, double d); ZEND_API void add_index_str(zval *arg, zend_ulong index, zend_string *str); ZEND_API void add_index_string(zval *arg, zend_ulong index, const char *str); ZEND_API void add_index_stringl(zval *arg, zend_ulong index, const char *str, size_t length); +ZEND_API void add_index_array(zval *arg, zend_ulong index, zend_array *arr); +ZEND_API void add_index_object(zval *arg, zend_ulong index, zend_object *obj); +ZEND_API void add_index_reference(zval *arg, zend_ulong index, zend_reference *ref); static zend_always_inline zend_result add_index_zval(zval *arg, zend_ulong index, zval *value) { @@ -473,12 +515,15 @@ static zend_always_inline zend_result add_index_zval(zval *arg, zend_ulong index ZEND_API zend_result add_next_index_long(zval *arg, zend_long n); ZEND_API zend_result add_next_index_null(zval *arg); -ZEND_API zend_result add_next_index_bool(zval *arg, zend_bool b); +ZEND_API zend_result add_next_index_bool(zval *arg, bool b); ZEND_API zend_result add_next_index_resource(zval *arg, zend_resource *r); ZEND_API zend_result add_next_index_double(zval *arg, double d); ZEND_API zend_result add_next_index_str(zval *arg, zend_string *str); ZEND_API zend_result add_next_index_string(zval *arg, const char *str); ZEND_API zend_result add_next_index_stringl(zval *arg, const char *str, size_t length); +ZEND_API zend_result add_next_index_array(zval *arg, zend_array *arr); +ZEND_API zend_result add_next_index_object(zval *arg, zend_object *obj); +ZEND_API zend_result add_next_index_reference(zval *arg, zend_reference *ref); static zend_always_inline zend_result add_next_index_zval(zval *arg, zval *value) { @@ -495,6 +540,9 @@ ZEND_API void add_property_double_ex(zval *arg, const char *key, size_t key_len, ZEND_API void add_property_str_ex(zval *arg, const char *key, size_t key_len, zend_string *str); ZEND_API void add_property_string_ex(zval *arg, const char *key, size_t key_len, const char *str); ZEND_API void add_property_stringl_ex(zval *arg, const char *key, size_t key_len, const char *str, size_t length); +ZEND_API void add_property_array_ex(zval *arg, const char *key, size_t key_len, zend_array *arr); +ZEND_API void add_property_object_ex(zval *arg, const char *key, size_t key_len, zend_object *obj); +ZEND_API void add_property_reference_ex(zval *arg, const char *key, size_t key_len, zend_reference *ref); ZEND_API void add_property_zval_ex(zval *arg, const char *key, size_t key_len, zval *value); #define add_property_long(__arg, __key, __n) add_property_long_ex(__arg, __key, strlen(__key), __n) @@ -505,6 +553,9 @@ ZEND_API void add_property_zval_ex(zval *arg, const char *key, size_t key_len, z #define add_property_str(__arg, __key, __str) add_property_str_ex(__arg, __key, strlen(__key), __str) #define add_property_string(__arg, __key, __str) add_property_string_ex(__arg, __key, strlen(__key), __str) #define add_property_stringl(__arg, __key, __str, __length) add_property_stringl_ex(__arg, __key, strlen(__key), __str, __length) +#define add_property_array(__arg, __key, __arr) add_property_array_ex(__arg, __key, strlen(__key), __arr) +#define add_property_object(__arg, __key, __obj) add_property_object_ex(__arg, __key, strlen(__key), __obj) +#define add_property_reference(__arg, __key, __ref) add_property_reference_ex(__arg, __key, strlen(__key), __ref) #define add_property_zval(__arg, __key, __value) add_property_zval_ex(__arg, __key, strlen(__key), __value) @@ -605,7 +656,7 @@ static zend_always_inline void zend_call_known_instance_method_with_1_params( ZEND_API void zend_call_known_instance_method_with_2_params( zend_function *fn, zend_object *object, zval *retval_ptr, zval *param1, zval *param2); -ZEND_API zend_result zend_set_hash_symbol(zval *symbol, const char *name, size_t name_length, zend_bool is_ref, int num_symbol_tables, ...); +ZEND_API zend_result zend_set_hash_symbol(zval *symbol, const char *name, size_t name_length, bool is_ref, int num_symbol_tables, ...); ZEND_API zend_result zend_delete_global_variable(zend_string *name); @@ -630,9 +681,9 @@ static zend_always_inline zend_result zend_forbid_dynamic_call(const char *func_ ZEND_API ZEND_COLD const char *zend_get_object_type(const zend_class_entry *ce); -ZEND_API zend_bool zend_is_iterable(zval *iterable); +ZEND_API bool zend_is_iterable(zval *iterable); -ZEND_API zend_bool zend_is_countable(zval *countable); +ZEND_API bool zend_is_countable(zval *countable); ZEND_API zend_result zend_get_default_from_internal_arg_info( zval *default_value_zval, zend_internal_arg_info *arg_info); @@ -779,11 +830,11 @@ END_EXTERN_C() /* May modify arg in-place. Will free arg in failure case (and take ownership in success case). * Prefer using the ZEND_TRY_ASSIGN_* macros over these APIs. */ -ZEND_API zend_result zend_try_assign_typed_ref_ex(zend_reference *ref, zval *zv, zend_bool strict); +ZEND_API zend_result zend_try_assign_typed_ref_ex(zend_reference *ref, zval *zv, bool strict); ZEND_API zend_result zend_try_assign_typed_ref(zend_reference *ref, zval *zv); ZEND_API zend_result zend_try_assign_typed_ref_null(zend_reference *ref); -ZEND_API zend_result zend_try_assign_typed_ref_bool(zend_reference *ref, zend_bool val); +ZEND_API zend_result zend_try_assign_typed_ref_bool(zend_reference *ref, bool val); ZEND_API zend_result zend_try_assign_typed_ref_long(zend_reference *ref, zend_long lval); ZEND_API zend_result zend_try_assign_typed_ref_double(zend_reference *ref, double dval); ZEND_API zend_result zend_try_assign_typed_ref_empty_string(zend_reference *ref); @@ -793,7 +844,7 @@ ZEND_API zend_result zend_try_assign_typed_ref_stringl(zend_reference *ref, cons ZEND_API zend_result zend_try_assign_typed_ref_arr(zend_reference *ref, zend_array *arr); ZEND_API zend_result zend_try_assign_typed_ref_res(zend_reference *ref, zend_resource *res); ZEND_API zend_result zend_try_assign_typed_ref_zval(zend_reference *ref, zval *zv); -ZEND_API zend_result zend_try_assign_typed_ref_zval_ex(zend_reference *ref, zval *zv, zend_bool strict); +ZEND_API zend_result zend_try_assign_typed_ref_zval_ex(zend_reference *ref, zval *zv, bool strict); #define _ZEND_TRY_ASSIGN_NULL(zv, is_ref) do { \ zval *_zv = zv; \ @@ -1255,6 +1306,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_long_or_null 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_wrong_callback_or_null_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, ...); ZEND_API ZEND_COLD void zend_argument_type_error(uint32_t arg_num, const char *format, ...); @@ -1272,6 +1324,7 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char * #define ZPP_ERROR_WRONG_ARG 9 #define ZPP_ERROR_WRONG_COUNT 10 #define ZPP_ERROR_UNEXPECTED_EXTRA_NAMED 11 +#define ZPP_ERROR_WRONG_CALLBACK_OR_NULL 12 #define ZEND_PARSE_PARAMETERS_START_EX(flags, min_num_args, max_num_args) do { \ const int _flags = (flags); \ @@ -1282,8 +1335,8 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char * zval *_real_arg, *_arg = NULL; \ zend_expected_type _expected_type = Z_EXPECTED_LONG; \ char *_error = NULL; \ - ZEND_ATTRIBUTE_UNUSED zend_bool _dummy; \ - zend_bool _optional = 0; \ + ZEND_ATTRIBUTE_UNUSED bool _dummy; \ + bool _optional = 0; \ int _error_code = ZPP_ERROR_OK; \ ((void)_i); \ ((void)_real_arg); \ @@ -1314,6 +1367,7 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char * } while (0) #define ZEND_PARSE_PARAMETERS_END_EX(failure) \ + ZEND_ASSERT(_i == _max_num_args || _max_num_args == (uint32_t) -1); \ } while (0); \ if (UNEXPECTED(_error_code != ZPP_ERROR_OK)) { \ if (!(_flags & ZEND_PARSE_PARAMS_QUIET)) { \ @@ -1396,17 +1450,14 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char * Z_PARAM_ITERABLE_EX(dest, 1) /* old "b" */ -#define Z_PARAM_BOOL_EX2(dest, is_null, check_null, deref, separate) \ - Z_PARAM_PROLOGUE(deref, separate); \ - if (UNEXPECTED(!zend_parse_arg_bool(_arg, &dest, &is_null, check_null))) { \ +#define Z_PARAM_BOOL_EX(dest, is_null, check_null, deref) \ + Z_PARAM_PROLOGUE(deref, 0); \ + if (UNEXPECTED(!zend_parse_arg_bool(_arg, &dest, &is_null, check_null, _i))) { \ _expected_type = check_null ? Z_EXPECTED_BOOL_OR_NULL : Z_EXPECTED_BOOL; \ _error_code = ZPP_ERROR_WRONG_ARG; \ break; \ } -#define Z_PARAM_BOOL_EX(dest, is_null, check_null, separate) \ - Z_PARAM_BOOL_EX2(dest, is_null, check_null, separate, separate) - #define Z_PARAM_BOOL(dest) \ Z_PARAM_BOOL_EX(dest, _dummy, 0, 0) @@ -1414,16 +1465,13 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char * Z_PARAM_BOOL_EX(dest, is_null, 1, 0) /* old "C" */ -#define Z_PARAM_CLASS_EX2(dest, check_null, deref, separate) \ - Z_PARAM_PROLOGUE(deref, separate); \ +#define Z_PARAM_CLASS_EX(dest, check_null, deref) \ + Z_PARAM_PROLOGUE(deref, 0); \ if (UNEXPECTED(!zend_parse_arg_class(_arg, &dest, _i, check_null))) { \ _error_code = ZPP_ERROR_FAILURE; \ break; \ } -#define Z_PARAM_CLASS_EX(dest, check_null, separate) \ - Z_PARAM_CLASS_EX2(dest, check_null, separate, separate) - #define Z_PARAM_CLASS(dest) \ Z_PARAM_CLASS_EX(dest, 0, 0) @@ -1446,7 +1494,7 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char * #define Z_PARAM_OBJ_OR_STR_EX(destination_object, destination_string, allow_null) \ Z_PARAM_PROLOGUE(0, 0); \ - if (UNEXPECTED(!zend_parse_arg_obj_or_str(_arg, &destination_object, NULL, &destination_string, allow_null))) { \ + if (UNEXPECTED(!zend_parse_arg_obj_or_str(_arg, &destination_object, NULL, &destination_string, allow_null, _i))) { \ _expected_type = allow_null ? Z_EXPECTED_OBJECT_OR_STRING_OR_NULL : Z_EXPECTED_OBJECT_OR_STRING; \ _error_code = ZPP_ERROR_WRONG_ARG; \ break; \ @@ -1460,7 +1508,7 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char * #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_obj_or_str(_arg, &destination_object, base_ce, &destination_string, allow_null))) { \ + if (UNEXPECTED(!zend_parse_arg_obj_or_str(_arg, &destination_object, base_ce, &destination_string, allow_null, _i))) { \ if (base_ce) { \ _error = ZSTR_VAL((base_ce)->name); \ _error_code = allow_null ? ZPP_ERROR_WRONG_CLASS_OR_STRING_OR_NULL : ZPP_ERROR_WRONG_CLASS_OR_STRING; \ @@ -1479,17 +1527,14 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char * 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) \ - Z_PARAM_PROLOGUE(deref, separate); \ - if (UNEXPECTED(!zend_parse_arg_double(_arg, &dest, &is_null, check_null))) { \ +#define Z_PARAM_DOUBLE_EX(dest, is_null, check_null, deref) \ + Z_PARAM_PROLOGUE(deref, 0); \ + if (UNEXPECTED(!zend_parse_arg_double(_arg, &dest, &is_null, check_null, _i))) { \ _expected_type = check_null ? Z_EXPECTED_DOUBLE_OR_NULL : Z_EXPECTED_DOUBLE; \ _error_code = ZPP_ERROR_WRONG_ARG; \ break; \ } -#define Z_PARAM_DOUBLE_EX(dest, is_null, check_null, separate) \ - Z_PARAM_DOUBLE_EX2(dest, is_null, check_null, separate, separate) - #define Z_PARAM_DOUBLE(dest) \ Z_PARAM_DOUBLE_EX(dest, _dummy, 0, 0) @@ -1497,21 +1542,18 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char * Z_PARAM_DOUBLE_EX(dest, is_null, 1, 0) /* old "f" */ -#define Z_PARAM_FUNC_EX2(dest_fci, dest_fcc, check_null, deref, separate) \ - Z_PARAM_PROLOGUE(deref, separate); \ +#define Z_PARAM_FUNC_EX(dest_fci, dest_fcc, check_null, deref) \ + Z_PARAM_PROLOGUE(deref, 0); \ if (UNEXPECTED(!zend_parse_arg_func(_arg, &dest_fci, &dest_fcc, check_null, &_error))) { \ if (!_error) { \ _expected_type = check_null ? Z_EXPECTED_FUNC_OR_NULL : Z_EXPECTED_FUNC; \ _error_code = ZPP_ERROR_WRONG_ARG; \ } else { \ - _error_code = ZPP_ERROR_WRONG_CALLBACK; \ + _error_code = check_null ? ZPP_ERROR_WRONG_CALLBACK_OR_NULL : ZPP_ERROR_WRONG_CALLBACK; \ } \ break; \ } \ -#define Z_PARAM_FUNC_EX(dest_fci, dest_fcc, check_null, separate) \ - Z_PARAM_FUNC_EX2(dest_fci, dest_fcc, check_null, separate, separate) - #define Z_PARAM_FUNC(dest_fci, dest_fcc) \ Z_PARAM_FUNC_EX(dest_fci, dest_fcc, 0, 0) @@ -1538,7 +1580,7 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char * #define Z_PARAM_ARRAY_HT_OR_LONG_EX(dest_ht, dest_long, is_null, allow_null) \ Z_PARAM_PROLOGUE(0, 0); \ - if (UNEXPECTED(!zend_parse_arg_array_ht_or_long(_arg, &dest_ht, &dest_long, &is_null, allow_null))) { \ + if (UNEXPECTED(!zend_parse_arg_array_ht_or_long(_arg, &dest_ht, &dest_long, &is_null, allow_null, _i))) { \ _expected_type = allow_null ? Z_EXPECTED_ARRAY_OR_LONG_OR_NULL : Z_EXPECTED_ARRAY_OR_LONG; \ _error_code = ZPP_ERROR_WRONG_ARG; \ break; \ @@ -1566,17 +1608,14 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char * Z_PARAM_ARRAY_OR_OBJECT_HT_EX(dest, 0, 0) /* old "l" */ -#define Z_PARAM_LONG_EX2(dest, is_null, check_null, deref, separate) \ - Z_PARAM_PROLOGUE(deref, separate); \ - if (UNEXPECTED(!zend_parse_arg_long(_arg, &dest, &is_null, check_null))) { \ +#define Z_PARAM_LONG_EX(dest, is_null, check_null, deref) \ + Z_PARAM_PROLOGUE(deref, 0); \ + if (UNEXPECTED(!zend_parse_arg_long(_arg, &dest, &is_null, check_null, _i))) { \ _expected_type = check_null ? Z_EXPECTED_LONG_OR_NULL : Z_EXPECTED_LONG; \ _error_code = ZPP_ERROR_WRONG_ARG; \ break; \ } -#define Z_PARAM_LONG_EX(dest, is_null, check_null, separate) \ - Z_PARAM_LONG_EX2(dest, is_null, check_null, separate, separate) - #define Z_PARAM_LONG(dest) \ Z_PARAM_LONG_EX(dest, _dummy, 0, 0) @@ -1586,7 +1625,7 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char * /* old "n" */ #define Z_PARAM_NUMBER_EX(dest, check_null) \ Z_PARAM_PROLOGUE(0, 0); \ - if (UNEXPECTED(!zend_parse_arg_number(_arg, &dest, check_null))) { \ + if (UNEXPECTED(!zend_parse_arg_number(_arg, &dest, check_null, _i))) { \ _expected_type = check_null ? Z_EXPECTED_NUMBER_OR_NULL : Z_EXPECTED_NUMBER; \ _error_code = ZPP_ERROR_WRONG_ARG; \ break; \ @@ -1599,35 +1638,29 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char * Z_PARAM_NUMBER_EX(dest, 0) /* old "o" */ -#define Z_PARAM_OBJECT_EX2(dest, check_null, deref, separate) \ - Z_PARAM_PROLOGUE(deref, separate); \ +#define Z_PARAM_OBJECT_EX(dest, check_null, deref) \ + Z_PARAM_PROLOGUE(deref, 0); \ if (UNEXPECTED(!zend_parse_arg_object(_arg, &dest, NULL, check_null))) { \ _expected_type = check_null ? Z_EXPECTED_OBJECT_OR_NULL : Z_EXPECTED_OBJECT; \ _error_code = ZPP_ERROR_WRONG_ARG; \ break; \ } -#define Z_PARAM_OBJECT_EX(dest, check_null, separate) \ - Z_PARAM_OBJECT_EX2(dest, check_null, separate, separate) - #define Z_PARAM_OBJECT(dest) \ Z_PARAM_OBJECT_EX(dest, 0, 0) #define Z_PARAM_OBJECT_OR_NULL(dest) \ Z_PARAM_OBJECT_EX(dest, 1, 0) -/* The same as Z_PARAM_OBJECT_EX2 except that dest is a zend_object rather than a zval */ -#define Z_PARAM_OBJ_EX2(dest, check_null, deref, separate) \ - Z_PARAM_PROLOGUE(deref, separate); \ +/* The same as Z_PARAM_OBJECT_EX except that dest is a zend_object rather than a zval */ +#define Z_PARAM_OBJ_EX(dest, check_null, deref) \ + Z_PARAM_PROLOGUE(deref, 0); \ if (UNEXPECTED(!zend_parse_arg_obj(_arg, &dest, NULL, check_null))) { \ _expected_type = check_null ? Z_EXPECTED_OBJECT_OR_NULL : Z_EXPECTED_OBJECT; \ _error_code = ZPP_ERROR_WRONG_ARG; \ break; \ } -#define Z_PARAM_OBJ_EX(dest, check_null, separate) \ - Z_PARAM_OBJ_EX2(dest, check_null, separate, separate) - #define Z_PARAM_OBJ(dest) \ Z_PARAM_OBJ_EX(dest, 0, 0) @@ -1635,8 +1668,8 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char * Z_PARAM_OBJ_EX(dest, 1, 0) /* old "O" */ -#define Z_PARAM_OBJECT_OF_CLASS_EX2(dest, _ce, check_null, deref, separate) \ - Z_PARAM_PROLOGUE(deref, separate); \ +#define Z_PARAM_OBJECT_OF_CLASS_EX(dest, _ce, check_null, deref) \ + Z_PARAM_PROLOGUE(deref, 0); \ if (UNEXPECTED(!zend_parse_arg_object(_arg, &dest, _ce, check_null))) { \ if (_ce) { \ _error = ZSTR_VAL((_ce)->name); \ @@ -1649,18 +1682,15 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char * } \ } -#define Z_PARAM_OBJECT_OF_CLASS_EX(dest, _ce, check_null, separate) \ - Z_PARAM_OBJECT_OF_CLASS_EX2(dest, _ce, check_null, separate, separate) - #define Z_PARAM_OBJECT_OF_CLASS(dest, _ce) \ Z_PARAM_OBJECT_OF_CLASS_EX(dest, _ce, 0, 0) #define Z_PARAM_OBJECT_OF_CLASS_OR_NULL(dest, _ce) \ Z_PARAM_OBJECT_OF_CLASS_EX(dest, _ce, 1, 0) -/* The same as Z_PARAM_OBJECT_OF_CLASS_EX2 except that dest is a zend_object rather than a zval */ -#define Z_PARAM_OBJ_OF_CLASS_EX2(dest, _ce, check_null, deref, separate) \ - Z_PARAM_PROLOGUE(deref, separate); \ +/* The same as Z_PARAM_OBJECT_OF_CLASS_EX except that dest is a zend_object rather than a zval */ +#define Z_PARAM_OBJ_OF_CLASS_EX(dest, _ce, check_null, deref) \ + Z_PARAM_PROLOGUE(deref, 0); \ if (UNEXPECTED(!zend_parse_arg_obj(_arg, &dest, _ce, check_null))) { \ if (_ce) { \ _error = ZSTR_VAL((_ce)->name); \ @@ -1673,9 +1703,6 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char * } \ } -#define Z_PARAM_OBJ_OF_CLASS_EX(dest, _ce, check_null, separate) \ - Z_PARAM_OBJ_OF_CLASS_EX2(dest, _ce, check_null, separate, separate) - #define Z_PARAM_OBJ_OF_CLASS(dest, _ce) \ Z_PARAM_OBJ_OF_CLASS_EX(dest, _ce, 0, 0) @@ -1684,7 +1711,7 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char * #define Z_PARAM_OBJ_OF_CLASS_OR_LONG_EX(dest_obj, _ce, dest_long, is_null, allow_null) \ Z_PARAM_PROLOGUE(0, 0); \ - if (UNEXPECTED(!zend_parse_arg_obj_or_long(_arg, &dest_obj, _ce, &dest_long, &is_null, allow_null))) { \ + if (UNEXPECTED(!zend_parse_arg_obj_or_long(_arg, &dest_obj, _ce, &dest_long, &is_null, allow_null, _i))) { \ _error = ZSTR_VAL((_ce)->name); \ _error_code = allow_null ? ZPP_ERROR_WRONG_CLASS_OR_LONG_OR_NULL : ZPP_ERROR_WRONG_CLASS_OR_LONG; \ break; \ @@ -1697,17 +1724,14 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char * Z_PARAM_OBJ_OF_CLASS_OR_LONG_EX(dest_obj, _ce, dest_long, is_null, 1) /* old "p" */ -#define Z_PARAM_PATH_EX2(dest, dest_len, check_null, deref, separate) \ - Z_PARAM_PROLOGUE(deref, separate); \ - if (UNEXPECTED(!zend_parse_arg_path(_arg, &dest, &dest_len, check_null))) { \ +#define Z_PARAM_PATH_EX(dest, dest_len, check_null, deref) \ + Z_PARAM_PROLOGUE(deref, 0); \ + if (UNEXPECTED(!zend_parse_arg_path(_arg, &dest, &dest_len, check_null, _i))) { \ _expected_type = check_null ? Z_EXPECTED_PATH_OR_NULL : Z_EXPECTED_PATH; \ _error_code = ZPP_ERROR_WRONG_ARG; \ break; \ } -#define Z_PARAM_PATH_EX(dest, dest_len, check_null, separate) \ - Z_PARAM_PATH_EX2(dest, dest_len, check_null, separate, separate) - #define Z_PARAM_PATH(dest, dest_len) \ Z_PARAM_PATH_EX(dest, dest_len, 0, 0) @@ -1715,17 +1739,14 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char * Z_PARAM_PATH_EX(dest, dest_len, 1, 0) /* old "P" */ -#define Z_PARAM_PATH_STR_EX2(dest, check_null, deref, separate) \ - Z_PARAM_PROLOGUE(deref, separate); \ - if (UNEXPECTED(!zend_parse_arg_path_str(_arg, &dest, check_null))) { \ +#define Z_PARAM_PATH_STR_EX(dest, check_null, deref) \ + Z_PARAM_PROLOGUE(deref, 0); \ + if (UNEXPECTED(!zend_parse_arg_path_str(_arg, &dest, check_null, _i))) { \ _expected_type = check_null ? Z_EXPECTED_PATH_OR_NULL : Z_EXPECTED_PATH; \ _error_code = ZPP_ERROR_WRONG_ARG; \ break; \ } -#define Z_PARAM_PATH_STR_EX(dest, check_null, separate) \ - Z_PARAM_PATH_STR_EX2(dest, check_null, separate, separate) - #define Z_PARAM_PATH_STR(dest) \ Z_PARAM_PATH_STR_EX(dest, 0, 0) @@ -1733,17 +1754,14 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char * Z_PARAM_PATH_STR_EX(dest, 1, 0) /* old "r" */ -#define Z_PARAM_RESOURCE_EX2(dest, check_null, deref, separate) \ - Z_PARAM_PROLOGUE(deref, separate); \ +#define Z_PARAM_RESOURCE_EX(dest, check_null, deref) \ + Z_PARAM_PROLOGUE(deref, 0); \ if (UNEXPECTED(!zend_parse_arg_resource(_arg, &dest, check_null))) { \ _expected_type = check_null ? Z_EXPECTED_RESOURCE_OR_NULL : Z_EXPECTED_RESOURCE; \ _error_code = ZPP_ERROR_WRONG_ARG; \ break; \ } -#define Z_PARAM_RESOURCE_EX(dest, check_null, separate) \ - Z_PARAM_RESOURCE_EX2(dest, check_null, separate, separate) - #define Z_PARAM_RESOURCE(dest) \ Z_PARAM_RESOURCE_EX(dest, 0, 0) @@ -1751,17 +1769,14 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char * Z_PARAM_RESOURCE_EX(dest, 1, 0) /* old "s" */ -#define Z_PARAM_STRING_EX2(dest, dest_len, check_null, deref, separate) \ - Z_PARAM_PROLOGUE(deref, separate); \ - if (UNEXPECTED(!zend_parse_arg_string(_arg, &dest, &dest_len, check_null))) { \ +#define Z_PARAM_STRING_EX(dest, dest_len, check_null, deref) \ + Z_PARAM_PROLOGUE(deref, 0); \ + if (UNEXPECTED(!zend_parse_arg_string(_arg, &dest, &dest_len, check_null, _i))) { \ _expected_type = check_null ? Z_EXPECTED_STRING_OR_NULL : Z_EXPECTED_STRING; \ _error_code = ZPP_ERROR_WRONG_ARG; \ break; \ } -#define Z_PARAM_STRING_EX(dest, dest_len, check_null, separate) \ - Z_PARAM_STRING_EX2(dest, dest_len, check_null, separate, separate) - #define Z_PARAM_STRING(dest, dest_len) \ Z_PARAM_STRING_EX(dest, dest_len, 0, 0) @@ -1769,17 +1784,14 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char * Z_PARAM_STRING_EX(dest, dest_len, 1, 0) /* old "S" */ -#define Z_PARAM_STR_EX2(dest, check_null, deref, separate) \ - Z_PARAM_PROLOGUE(deref, separate); \ - if (UNEXPECTED(!zend_parse_arg_str(_arg, &dest, check_null))) { \ +#define Z_PARAM_STR_EX(dest, check_null, deref) \ + Z_PARAM_PROLOGUE(deref, 0); \ + if (UNEXPECTED(!zend_parse_arg_str(_arg, &dest, check_null, _i))) { \ _expected_type = check_null ? Z_EXPECTED_STRING_OR_NULL : Z_EXPECTED_STRING; \ _error_code = ZPP_ERROR_WRONG_ARG; \ break; \ } -#define Z_PARAM_STR_EX(dest, check_null, separate) \ - Z_PARAM_STR_EX2(dest, check_null, separate, separate) - #define Z_PARAM_STR(dest) \ Z_PARAM_STR_EX(dest, 0, 0) @@ -1839,7 +1851,7 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char * #define Z_PARAM_ARRAY_HT_OR_STR_EX(dest_ht, dest_str, allow_null) \ Z_PARAM_PROLOGUE(0, 0); \ - if (UNEXPECTED(!zend_parse_arg_array_ht_or_str(_arg, &dest_ht, &dest_str, allow_null))) { \ + if (UNEXPECTED(!zend_parse_arg_array_ht_or_str(_arg, &dest_ht, &dest_str, allow_null, _i))) { \ _expected_type = allow_null ? Z_EXPECTED_ARRAY_OR_STRING_OR_NULL : Z_EXPECTED_ARRAY_OR_STRING; \ _error_code = ZPP_ERROR_WRONG_ARG; \ break; \ @@ -1853,7 +1865,7 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char * #define Z_PARAM_STR_OR_LONG_EX(dest_str, dest_long, is_null, allow_null) \ Z_PARAM_PROLOGUE(0, 0); \ - if (UNEXPECTED(!zend_parse_arg_str_or_long(_arg, &dest_str, &dest_long, &is_null, allow_null))) { \ + if (UNEXPECTED(!zend_parse_arg_str_or_long(_arg, &dest_str, &dest_long, &is_null, allow_null, _i))) { \ _expected_type = allow_null ? Z_EXPECTED_STRING_OR_LONG_OR_NULL : Z_EXPECTED_STRING_OR_LONG; \ _error_code = ZPP_ERROR_WRONG_ARG; \ break; \ @@ -1870,18 +1882,18 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char * /* Inlined implementations shared by new and old parameter parsing APIs */ ZEND_API bool ZEND_FASTCALL zend_parse_arg_class(zval *arg, zend_class_entry **pce, uint32_t num, bool check_null); -ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_slow(zval *arg, zend_bool *dest); -ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_weak(zval *arg, zend_bool *dest); -ZEND_API bool ZEND_FASTCALL zend_parse_arg_long_slow(zval *arg, zend_long *dest); -ZEND_API bool ZEND_FASTCALL zend_parse_arg_long_weak(zval *arg, zend_long *dest); -ZEND_API bool ZEND_FASTCALL zend_parse_arg_double_slow(zval *arg, double *dest); -ZEND_API bool ZEND_FASTCALL zend_parse_arg_double_weak(zval *arg, double *dest); -ZEND_API bool ZEND_FASTCALL zend_parse_arg_str_slow(zval *arg, zend_string **dest); -ZEND_API bool ZEND_FASTCALL zend_parse_arg_str_weak(zval *arg, zend_string **dest); -ZEND_API bool ZEND_FASTCALL zend_parse_arg_number_slow(zval *arg, zval **dest); -ZEND_API bool ZEND_FASTCALL zend_parse_arg_str_or_long_slow(zval *arg, zend_string **dest_str, zend_long *dest_long); - -static zend_always_inline bool zend_parse_arg_bool(zval *arg, zend_bool *dest, zend_bool *is_null, bool check_null) +ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_slow(zval *arg, bool *dest, uint32_t arg_num); +ZEND_API bool ZEND_FASTCALL zend_parse_arg_bool_weak(zval *arg, bool *dest, uint32_t arg_num); +ZEND_API bool ZEND_FASTCALL zend_parse_arg_long_slow(zval *arg, zend_long *dest, uint32_t arg_num); +ZEND_API bool ZEND_FASTCALL zend_parse_arg_long_weak(zval *arg, zend_long *dest, uint32_t arg_num); +ZEND_API bool ZEND_FASTCALL zend_parse_arg_double_slow(zval *arg, double *dest, uint32_t arg_num); +ZEND_API bool ZEND_FASTCALL zend_parse_arg_double_weak(zval *arg, double *dest, uint32_t arg_num); +ZEND_API bool ZEND_FASTCALL zend_parse_arg_str_slow(zval *arg, zend_string **dest, uint32_t arg_num); +ZEND_API bool ZEND_FASTCALL zend_parse_arg_str_weak(zval *arg, zend_string **dest, uint32_t arg_num); +ZEND_API bool ZEND_FASTCALL zend_parse_arg_number_slow(zval *arg, zval **dest, uint32_t arg_num); +ZEND_API bool ZEND_FASTCALL zend_parse_arg_str_or_long_slow(zval *arg, zend_string **dest_str, zend_long *dest_long, uint32_t arg_num); + +static zend_always_inline bool zend_parse_arg_bool(zval *arg, bool *dest, bool *is_null, bool check_null, uint32_t arg_num) { if (check_null) { *is_null = 0; @@ -1894,12 +1906,12 @@ static zend_always_inline bool zend_parse_arg_bool(zval *arg, zend_bool *dest, z *is_null = 1; *dest = 0; } else { - return zend_parse_arg_bool_slow(arg, dest); + return zend_parse_arg_bool_slow(arg, dest, arg_num); } return 1; } -static zend_always_inline bool zend_parse_arg_long(zval *arg, zend_long *dest, zend_bool *is_null, bool check_null) +static zend_always_inline bool zend_parse_arg_long(zval *arg, zend_long *dest, bool *is_null, bool check_null, uint32_t arg_num) { if (check_null) { *is_null = 0; @@ -1910,12 +1922,12 @@ static zend_always_inline bool zend_parse_arg_long(zval *arg, zend_long *dest, z *is_null = 1; *dest = 0; } else { - return zend_parse_arg_long_slow(arg, dest); + return zend_parse_arg_long_slow(arg, dest, arg_num); } return 1; } -static zend_always_inline bool zend_parse_arg_double(zval *arg, double *dest, zend_bool *is_null, bool check_null) +static zend_always_inline bool zend_parse_arg_double(zval *arg, double *dest, bool *is_null, bool check_null, uint32_t arg_num) { if (check_null) { *is_null = 0; @@ -1926,40 +1938,40 @@ static zend_always_inline bool zend_parse_arg_double(zval *arg, double *dest, ze *is_null = 1; *dest = 0.0; } else { - return zend_parse_arg_double_slow(arg, dest); + return zend_parse_arg_double_slow(arg, dest, arg_num); } return 1; } -static zend_always_inline bool zend_parse_arg_number(zval *arg, zval **dest, bool check_null) +static zend_always_inline bool zend_parse_arg_number(zval *arg, zval **dest, bool check_null, uint32_t arg_num) { if (EXPECTED(Z_TYPE_P(arg) == IS_LONG || Z_TYPE_P(arg) == IS_DOUBLE)) { *dest = arg; } else if (check_null && EXPECTED(Z_TYPE_P(arg) == IS_NULL)) { *dest = NULL; } else { - return zend_parse_arg_number_slow(arg, dest); + return zend_parse_arg_number_slow(arg, dest, arg_num); } return 1; } -static zend_always_inline bool zend_parse_arg_str(zval *arg, zend_string **dest, bool check_null) +static zend_always_inline bool zend_parse_arg_str(zval *arg, zend_string **dest, bool check_null, uint32_t arg_num) { if (EXPECTED(Z_TYPE_P(arg) == IS_STRING)) { *dest = Z_STR_P(arg); } else if (check_null && Z_TYPE_P(arg) == IS_NULL) { *dest = NULL; } else { - return zend_parse_arg_str_slow(arg, dest); + return zend_parse_arg_str_slow(arg, dest, arg_num); } return 1; } -static zend_always_inline bool zend_parse_arg_string(zval *arg, char **dest, size_t *dest_len, bool check_null) +static zend_always_inline bool zend_parse_arg_string(zval *arg, char **dest, size_t *dest_len, bool check_null, uint32_t arg_num) { zend_string *str; - if (!zend_parse_arg_str(arg, &str, check_null)) { + if (!zend_parse_arg_str(arg, &str, check_null, arg_num)) { return 0; } if (check_null && UNEXPECTED(!str)) { @@ -1972,20 +1984,20 @@ static zend_always_inline bool zend_parse_arg_string(zval *arg, char **dest, siz return 1; } -static zend_always_inline bool zend_parse_arg_path_str(zval *arg, zend_string **dest, bool check_null) +static zend_always_inline bool zend_parse_arg_path_str(zval *arg, zend_string **dest, bool check_null, uint32_t arg_num) { - if (!zend_parse_arg_str(arg, dest, check_null) || + if (!zend_parse_arg_str(arg, dest, check_null, arg_num) || (*dest && UNEXPECTED(CHECK_NULL_PATH(ZSTR_VAL(*dest), ZSTR_LEN(*dest))))) { return 0; } return 1; } -static zend_always_inline bool zend_parse_arg_path(zval *arg, char **dest, size_t *dest_len, bool check_null) +static zend_always_inline bool zend_parse_arg_path(zval *arg, char **dest, size_t *dest_len, bool check_null, uint32_t arg_num) { zend_string *str; - if (!zend_parse_arg_path_str(arg, &str, check_null)) { + if (!zend_parse_arg_path_str(arg, &str, check_null, arg_num)) { return 0; } if (check_null && UNEXPECTED(!str)) { @@ -2050,7 +2062,7 @@ static zend_always_inline bool zend_parse_arg_array_ht(zval *arg, HashTable **de } static zend_always_inline bool zend_parse_arg_array_ht_or_long( - zval *arg, HashTable **dest_ht, zend_long *dest_long, zend_bool *is_null, bool allow_null + zval *arg, HashTable **dest_ht, zend_long *dest_long, bool *is_null, bool allow_null, uint32_t arg_num ) { if (allow_null) { *is_null = 0; @@ -2066,7 +2078,7 @@ static zend_always_inline bool zend_parse_arg_array_ht_or_long( *is_null = 1; } else { *dest_ht = NULL; - return zend_parse_arg_long_slow(arg, dest_long); + return zend_parse_arg_long_slow(arg, dest_long, arg_num); } return 1; @@ -2099,7 +2111,7 @@ static zend_always_inline bool zend_parse_arg_obj(zval *arg, zend_object **dest, } static zend_always_inline bool zend_parse_arg_obj_or_long( - zval *arg, zend_object **dest_obj, zend_class_entry *ce, zend_long *dest_long, zend_bool *is_null, bool allow_null + zval *arg, zend_object **dest_obj, zend_class_entry *ce, zend_long *dest_long, bool *is_null, bool allow_null, uint32_t arg_num ) { if (allow_null) { *is_null = 0; @@ -2115,7 +2127,7 @@ static zend_always_inline bool zend_parse_arg_obj_or_long( *is_null = 1; } else { *dest_obj = NULL; - return zend_parse_arg_long_slow(arg, dest_long); + return zend_parse_arg_long_slow(arg, dest_long, arg_num); } return 1; @@ -2163,7 +2175,7 @@ static zend_always_inline void zend_parse_arg_zval_deref(zval *arg, zval **dest, } static zend_always_inline bool zend_parse_arg_array_ht_or_str( - zval *arg, HashTable **dest_ht, zend_string **dest_str, bool allow_null) + zval *arg, HashTable **dest_ht, zend_string **dest_str, bool allow_null, uint32_t arg_num) { if (EXPECTED(Z_TYPE_P(arg) == IS_STRING)) { *dest_ht = NULL; @@ -2176,13 +2188,13 @@ static zend_always_inline bool zend_parse_arg_array_ht_or_str( *dest_str = NULL; } else { *dest_ht = NULL; - return zend_parse_arg_str_slow(arg, dest_str); + return zend_parse_arg_str_slow(arg, dest_str, arg_num); } return 1; } static zend_always_inline bool zend_parse_arg_str_or_long(zval *arg, zend_string **dest_str, zend_long *dest_long, - zend_bool *is_null, bool allow_null) + bool *is_null, bool allow_null, uint32_t arg_num) { if (allow_null) { *is_null = 0; @@ -2196,7 +2208,7 @@ static zend_always_inline bool zend_parse_arg_str_or_long(zval *arg, zend_string *dest_str = NULL; *is_null = 1; } else { - return zend_parse_arg_str_or_long_slow(arg, dest_str, dest_long); + return zend_parse_arg_str_or_long_slow(arg, dest_str, dest_long, arg_num); } return 1; } @@ -2220,7 +2232,7 @@ static zend_always_inline bool zend_parse_arg_obj_or_class_name( } 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 + zval *arg, zend_object **destination_object, zend_class_entry *base_ce, zend_string **destination_string, bool allow_null, uint32_t arg_num ) { if (EXPECTED(Z_TYPE_P(arg) == IS_OBJECT)) { if (!base_ce || EXPECTED(instanceof_function(Z_OBJCE_P(arg), base_ce))) { @@ -2231,7 +2243,7 @@ static zend_always_inline bool zend_parse_arg_obj_or_str( } *destination_object = NULL; - return zend_parse_arg_str(arg, destination_string, allow_null); + return zend_parse_arg_str(arg, destination_string, allow_null, arg_num); } END_EXTERN_C() |