@@ -90,7 +90,7 @@ ZEND_API ZEND_COLD void zend_wrong_param_count(void) /* {{{ */
9090 const char * space ;
9191 const char * class_name = get_active_class_name (& space );
9292
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 ());
9494}
9595/* }}} */
9696
@@ -173,28 +173,7 @@ ZEND_API ZEND_COLD int ZEND_FASTCALL zend_wrong_parameters_none_error(void) /* {
173173 zend_function * active_function = EG (current_execute_data )-> func ;
174174 const char * class_name = active_function -> common .scope ? ZSTR_VAL (active_function -> common .scope -> name ) : "" ;
175175
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 (
198177 "%s%s%s() expects %s %d parameter%s, %d given" ,
199178 class_name , \
200179 class_name [0 ] ? "::" : "" , \
@@ -213,27 +192,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameters_count_error(int min_
213192 zend_function * active_function = EG (current_execute_data )-> func ;
214193 const char * class_name = active_function -> common .scope ? ZSTR_VAL (active_function -> common .scope -> name ) : "" ;
215194
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 (
237196 "%s%s%s() expects %s %d parameter%s, %d given" ,
238197 class_name , \
239198 class_name [0 ] ? "::" : "" , \
@@ -254,21 +213,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_type_error(int num, z
254213 NULL
255214 };
256215
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" ,
272217 class_name , space , get_active_function_name (), num , expected_error [expected_type ], zend_zval_type_name (arg ));
273218}
274219/* }}} */
@@ -278,17 +223,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_error(int num,
278223 const char * space ;
279224 const char * class_name = get_active_class_name (& space );
280225
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" ,
292227 class_name , space , get_active_function_name (), num , name , zend_zval_type_name (arg ));
293228}
294229/* }}} */
@@ -298,18 +233,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(int num, char *e
298233 const char * space ;
299234 const char * class_name = get_active_class_name (& space );
300235
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" ,
313237 class_name , space , get_active_function_name (), num , error );
314238 efree (error );
315239}
@@ -330,7 +254,7 @@ ZEND_API int ZEND_FASTCALL zend_parse_arg_class(zval *arg, zend_class_entry **pc
330254 const char * space ;
331255 const char * class_name = get_active_class_name (& space );
332256
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" ,
334258 class_name , space , get_active_function_name (), num ,
335259 ZSTR_VAL (ce_base -> name ), Z_STRVAL_P (arg ));
336260 * pce = NULL ;
@@ -341,7 +265,7 @@ ZEND_API int ZEND_FASTCALL zend_parse_arg_class(zval *arg, zend_class_entry **pc
341265 const char * space ;
342266 const char * class_name = get_active_class_name (& space );
343267
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" ,
345269 class_name , space , get_active_function_name (), num ,
346270 Z_STRVAL_P (arg ));
347271 return 0 ;
@@ -803,16 +727,13 @@ static int zend_parse_arg(int arg_num, zval *arg, va_list *va, const char **spec
803727 if (!(flags & ZEND_PARSE_PARAMS_QUIET ) && (* expected_type || error )) {
804728 const char * space ;
805729 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 );
808730
809731 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" ,
811733 class_name , space , get_active_function_name (), arg_num , error );
812734 efree (error );
813735 } 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" ,
816737 class_name , space , get_active_function_name (), arg_num , expected_type ,
817738 zend_zval_type_name (arg ));
818739 }
@@ -919,8 +840,7 @@ static int zend_parse_va_args(int num_args, const char *type_spec, va_list *va,
919840 if (!(flags & ZEND_PARSE_PARAMS_QUIET )) {
920841 zend_function * active_function = EG (current_execute_data )-> func ;
921842 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" ,
924844 class_name ,
925845 class_name [0 ] ? "::" : "" ,
926846 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, ..
1013933{
1014934 va_list va ;
1015935 int retval ;
1016- int flags = ZEND_PARSE_PARAMS_THROW ;
936+ int flags = 0 ;
1017937
1018938 va_start (va , type_spec );
1019939 retval = zend_parse_va_args (num_args , type_spec , & va , flags );
0 commit comments