@@ -1069,23 +1069,25 @@ ZEND_FUNCTION(function_exists)
10691069ZEND_FUNCTION (class_alias )
10701070{
10711071 zend_string * class_name ;
1072- char * alias_name ;
1072+ zend_string * alias_name ;
10731073 zend_class_entry * ce ;
1074- size_t alias_name_len ;
10751074 bool autoload = 1 ;
10761075
1077- if (zend_parse_parameters (ZEND_NUM_ARGS (), "Ss|b" , & class_name , & alias_name , & alias_name_len , & autoload ) == FAILURE ) {
1078- RETURN_THROWS ();
1079- }
1076+ ZEND_PARSE_PARAMETERS_START (2 , 3 )
1077+ Z_PARAM_STR (class_name )
1078+ Z_PARAM_STR (alias_name )
1079+ Z_PARAM_OPTIONAL
1080+ Z_PARAM_BOOL (autoload )
1081+ ZEND_PARSE_PARAMETERS_END ();
10801082
10811083 ce = zend_lookup_class_ex (class_name , NULL , !autoload ? ZEND_FETCH_CLASS_NO_AUTOLOAD : 0 );
10821084
10831085 if (ce ) {
10841086 if (ce -> type == ZEND_USER_CLASS ) {
1085- if (zend_register_class_alias_ex (alias_name , alias_name_len , ce , 0 ) == SUCCESS ) {
1087+ if (zend_register_class_alias_ex (ZSTR_VAL ( alias_name ), ZSTR_LEN ( alias_name ) , ce , 0 ) == SUCCESS ) {
10861088 RETURN_TRUE ;
10871089 } else {
1088- zend_error (E_WARNING , "Cannot declare %s %s, because the name is already in use" , zend_get_object_type (ce ), alias_name );
1090+ zend_error (E_WARNING , "Cannot declare %s %s, because the name is already in use" , zend_get_object_type (ce ), ZSTR_VAL ( alias_name ) );
10891091 RETURN_FALSE ;
10901092 }
10911093 } else {
@@ -1152,10 +1154,11 @@ ZEND_FUNCTION(set_error_handler)
11521154 zend_fcall_info_cache fcc ;
11531155 zend_long error_type = E_ALL ;
11541156
1155- /* callable argument corresponds to the error handler */
1156- if (zend_parse_parameters (ZEND_NUM_ARGS (), "f!|l" , & fci , & fcc , & error_type ) == FAILURE ) {
1157- RETURN_THROWS ();
1158- }
1157+ ZEND_PARSE_PARAMETERS_START (1 , 2 )
1158+ Z_PARAM_FUNC_OR_NULL (fci , fcc )
1159+ Z_PARAM_OPTIONAL
1160+ Z_PARAM_LONG (error_type )
1161+ ZEND_PARSE_PARAMETERS_END ();
11591162
11601163 if (Z_TYPE (EG (user_error_handler )) != IS_UNDEF ) {
11611164 ZVAL_COPY (return_value , & EG (user_error_handler ));
@@ -1209,10 +1212,9 @@ ZEND_FUNCTION(set_exception_handler)
12091212 zend_fcall_info fci ;
12101213 zend_fcall_info_cache fcc ;
12111214
1212- /* callable argument corresponds to the exception handler */
1213- if (zend_parse_parameters (ZEND_NUM_ARGS (), "f!" , & fci , & fcc ) == FAILURE ) {
1214- RETURN_THROWS ();
1215- }
1215+ ZEND_PARSE_PARAMETERS_START (1 , 1 )
1216+ Z_PARAM_FUNC_OR_NULL (fci , fcc )
1217+ ZEND_PARSE_PARAMETERS_END ();
12161218
12171219 if (Z_TYPE (EG (user_exception_handler )) != IS_UNDEF ) {
12181220 ZVAL_COPY (return_value , & EG (user_exception_handler ));
0 commit comments