@@ -90,7 +90,7 @@ ZEND_API ZEND_COLD void zend_wrong_param_count(void) /* {{{ */
90
90
const char * space ;
91
91
const char * class_name = get_active_class_name (& space );
92
92
93
- zend_internal_argument_count_error ( ZEND_ARG_USES_STRICT_TYPES (), "Wrong parameter count for %s%s%s()" , class_name , space , get_active_function_name ());
93
+ zend_argument_count_error ( "Wrong parameter count for %s%s%s()" , class_name , space , get_active_function_name ());
94
94
}
95
95
/* }}} */
96
96
@@ -173,28 +173,7 @@ ZEND_API ZEND_COLD int ZEND_FASTCALL zend_wrong_parameters_none_error(void) /* {
173
173
zend_function * active_function = EG (current_execute_data )-> func ;
174
174
const char * class_name = active_function -> common .scope ? ZSTR_VAL (active_function -> common .scope -> name ) : "" ;
175
175
176
- zend_internal_argument_count_error (
177
- ZEND_ARG_USES_STRICT_TYPES (),
178
- "%s%s%s() expects %s %d parameter%s, %d given" ,
179
- class_name , \
180
- class_name [0 ] ? "::" : "" , \
181
- ZSTR_VAL (active_function -> common .function_name ),
182
- "exactly" ,
183
- 0 ,
184
- "s" ,
185
- num_args );
186
- return FAILURE ;
187
- }
188
- /* }}} */
189
-
190
- ZEND_API ZEND_COLD int ZEND_FASTCALL zend_wrong_parameters_none_exception (void ) /* {{{ */
191
- {
192
- int num_args = ZEND_CALL_NUM_ARGS (EG (current_execute_data ));
193
- zend_function * active_function = EG (current_execute_data )-> func ;
194
- const char * class_name = active_function -> common .scope ? ZSTR_VAL (active_function -> common .scope -> name ) : "" ;
195
-
196
- zend_internal_argument_count_error (
197
- 1 ,
176
+ zend_argument_count_error (
198
177
"%s%s%s() expects %s %d parameter%s, %d given" ,
199
178
class_name , \
200
179
class_name [0 ] ? "::" : "" , \
@@ -213,27 +192,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameters_count_error(int min_
213
192
zend_function * active_function = EG (current_execute_data )-> func ;
214
193
const char * class_name = active_function -> common .scope ? ZSTR_VAL (active_function -> common .scope -> name ) : "" ;
215
194
216
- zend_internal_argument_count_error (
217
- ZEND_ARG_USES_STRICT_TYPES (),
218
- "%s%s%s() expects %s %d parameter%s, %d given" ,
219
- class_name , \
220
- class_name [0 ] ? "::" : "" , \
221
- ZSTR_VAL (active_function -> common .function_name ),
222
- min_num_args == max_num_args ? "exactly" : num_args < min_num_args ? "at least" : "at most" ,
223
- num_args < min_num_args ? min_num_args : max_num_args ,
224
- (num_args < min_num_args ? min_num_args : max_num_args ) == 1 ? "" : "s" ,
225
- num_args );
226
- }
227
- /* }}} */
228
-
229
- ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameters_count_exception (int min_num_args , int max_num_args ) /* {{{ */
230
- {
231
- int num_args = ZEND_CALL_NUM_ARGS (EG (current_execute_data ));
232
- zend_function * active_function = EG (current_execute_data )-> func ;
233
- const char * class_name = active_function -> common .scope ? ZSTR_VAL (active_function -> common .scope -> name ) : "" ;
234
-
235
- zend_internal_argument_count_error (
236
- 1 ,
195
+ zend_argument_count_error (
237
196
"%s%s%s() expects %s %d parameter%s, %d given" ,
238
197
class_name , \
239
198
class_name [0 ] ? "::" : "" , \
@@ -254,21 +213,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_type_error(int num, z
254
213
NULL
255
214
};
256
215
257
- zend_internal_type_error (ZEND_ARG_USES_STRICT_TYPES (), "%s%s%s() expects parameter %d to be %s, %s given" ,
258
- class_name , space , get_active_function_name (), num , expected_error [expected_type ], zend_zval_type_name (arg ));
259
- }
260
- /* }}} */
261
-
262
- ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_type_exception (int num , zend_expected_type expected_type , zval * arg ) /* {{{ */
263
- {
264
- const char * space ;
265
- const char * class_name = get_active_class_name (& space );
266
- static const char * const expected_error [] = {
267
- Z_EXPECTED_TYPES (Z_EXPECTED_TYPE_STR )
268
- NULL
269
- };
270
-
271
- zend_internal_type_error (1 , "%s%s%s() expects parameter %d to be %s, %s given" ,
216
+ zend_type_error ("%s%s%s() expects parameter %d to be %s, %s given" ,
272
217
class_name , space , get_active_function_name (), num , expected_error [expected_type ], zend_zval_type_name (arg ));
273
218
}
274
219
/* }}} */
@@ -278,17 +223,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_error(int num,
278
223
const char * space ;
279
224
const char * class_name = get_active_class_name (& space );
280
225
281
- zend_internal_type_error (ZEND_ARG_USES_STRICT_TYPES (), "%s%s%s() expects parameter %d to be %s, %s given" ,
282
- class_name , space , get_active_function_name (), num , name , zend_zval_type_name (arg ));
283
- }
284
- /* }}} */
285
-
286
- ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_exception (int num , char * name , zval * arg ) /* {{{ */
287
- {
288
- const char * space ;
289
- const char * class_name = get_active_class_name (& space );
290
-
291
- zend_internal_type_error (1 , "%s%s%s() expects parameter %d to be %s, %s given" ,
226
+ zend_type_error ("%s%s%s() expects parameter %d to be %s, %s given" ,
292
227
class_name , space , get_active_function_name (), num , name , zend_zval_type_name (arg ));
293
228
}
294
229
/* }}} */
@@ -298,18 +233,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(int num, char *e
298
233
const char * space ;
299
234
const char * class_name = get_active_class_name (& space );
300
235
301
- zend_internal_type_error (ZEND_ARG_USES_STRICT_TYPES (), "%s%s%s() expects parameter %d to be a valid callback, %s" ,
302
- class_name , space , get_active_function_name (), num , error );
303
- efree (error );
304
- }
305
- /* }}} */
306
-
307
- ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_exception (int num , char * error ) /* {{{ */
308
- {
309
- const char * space ;
310
- const char * class_name = get_active_class_name (& space );
311
-
312
- zend_internal_type_error (1 , "%s%s%s() expects parameter %d to be a valid callback, %s" ,
236
+ zend_type_error ("%s%s%s() expects parameter %d to be a valid callback, %s" ,
313
237
class_name , space , get_active_function_name (), num , error );
314
238
efree (error );
315
239
}
@@ -330,7 +254,7 @@ ZEND_API int ZEND_FASTCALL zend_parse_arg_class(zval *arg, zend_class_entry **pc
330
254
const char * space ;
331
255
const char * class_name = get_active_class_name (& space );
332
256
333
- zend_internal_type_error ( ZEND_ARG_USES_STRICT_TYPES (), "%s%s%s() expects parameter %d to be a class name derived from %s, '%s' given" ,
257
+ zend_type_error ( "%s%s%s() expects parameter %d to be a class name derived from %s, '%s' given" ,
334
258
class_name , space , get_active_function_name (), num ,
335
259
ZSTR_VAL (ce_base -> name ), Z_STRVAL_P (arg ));
336
260
* pce = NULL ;
@@ -341,7 +265,7 @@ ZEND_API int ZEND_FASTCALL zend_parse_arg_class(zval *arg, zend_class_entry **pc
341
265
const char * space ;
342
266
const char * class_name = get_active_class_name (& space );
343
267
344
- zend_internal_type_error ( ZEND_ARG_USES_STRICT_TYPES (), "%s%s%s() expects parameter %d to be a valid class name, '%s' given" ,
268
+ zend_type_error ( "%s%s%s() expects parameter %d to be a valid class name, '%s' given" ,
345
269
class_name , space , get_active_function_name (), num ,
346
270
Z_STRVAL_P (arg ));
347
271
return 0 ;
@@ -803,16 +727,13 @@ static int zend_parse_arg(int arg_num, zval *arg, va_list *va, const char **spec
803
727
if (!(flags & ZEND_PARSE_PARAMS_QUIET ) && (* expected_type || error )) {
804
728
const char * space ;
805
729
const char * class_name = get_active_class_name (& space );
806
- zend_bool throw_exception =
807
- ZEND_ARG_USES_STRICT_TYPES () || (flags & ZEND_PARSE_PARAMS_THROW );
808
730
809
731
if (error ) {
810
- zend_internal_type_error ( throw_exception , "%s%s%s() expects parameter %d %s" ,
732
+ zend_type_error ( "%s%s%s() expects parameter %d %s" ,
811
733
class_name , space , get_active_function_name (), arg_num , error );
812
734
efree (error );
813
735
} else {
814
- zend_internal_type_error (throw_exception ,
815
- "%s%s%s() expects parameter %d to be %s, %s given" ,
736
+ zend_type_error ("%s%s%s() expects parameter %d to be %s, %s given" ,
816
737
class_name , space , get_active_function_name (), arg_num , expected_type ,
817
738
zend_zval_type_name (arg ));
818
739
}
@@ -919,8 +840,7 @@ static int zend_parse_va_args(int num_args, const char *type_spec, va_list *va,
919
840
if (!(flags & ZEND_PARSE_PARAMS_QUIET )) {
920
841
zend_function * active_function = EG (current_execute_data )-> func ;
921
842
const char * class_name = active_function -> common .scope ? ZSTR_VAL (active_function -> common .scope -> name ) : "" ;
922
- zend_bool throw_exception = ZEND_ARG_USES_STRICT_TYPES () || (flags & ZEND_PARSE_PARAMS_THROW );
923
- zend_internal_argument_count_error (throw_exception , "%s%s%s() expects %s %d parameter%s, %d given" ,
843
+ zend_argument_count_error ("%s%s%s() expects %s %d parameter%s, %d given" ,
924
844
class_name ,
925
845
class_name [0 ] ? "::" : "" ,
926
846
ZSTR_VAL (active_function -> common .function_name ),
@@ -1013,7 +933,7 @@ ZEND_API int zend_parse_parameters_throw(int num_args, const char *type_spec, ..
1013
933
{
1014
934
va_list va ;
1015
935
int retval ;
1016
- int flags = ZEND_PARSE_PARAMS_THROW ;
936
+ int flags = 0 ;
1017
937
1018
938
va_start (va , type_spec );
1019
939
retval = zend_parse_va_args (num_args , type_spec , & va , flags );
0 commit comments