@@ -1069,23 +1069,25 @@ ZEND_FUNCTION(function_exists)
1069
1069
ZEND_FUNCTION (class_alias )
1070
1070
{
1071
1071
zend_string * class_name ;
1072
- char * alias_name ;
1072
+ zend_string * alias_name ;
1073
1073
zend_class_entry * ce ;
1074
- size_t alias_name_len ;
1075
1074
bool autoload = 1 ;
1076
1075
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 ();
1080
1082
1081
1083
ce = zend_lookup_class_ex (class_name , NULL , !autoload ? ZEND_FETCH_CLASS_NO_AUTOLOAD : 0 );
1082
1084
1083
1085
if (ce ) {
1084
1086
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 ) {
1086
1088
RETURN_TRUE ;
1087
1089
} 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 ) );
1089
1091
RETURN_FALSE ;
1090
1092
}
1091
1093
} else {
@@ -1152,10 +1154,11 @@ ZEND_FUNCTION(set_error_handler)
1152
1154
zend_fcall_info_cache fcc ;
1153
1155
zend_long error_type = E_ALL ;
1154
1156
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 ();
1159
1162
1160
1163
if (Z_TYPE (EG (user_error_handler )) != IS_UNDEF ) {
1161
1164
ZVAL_COPY (return_value , & EG (user_error_handler ));
@@ -1209,10 +1212,9 @@ ZEND_FUNCTION(set_exception_handler)
1209
1212
zend_fcall_info fci ;
1210
1213
zend_fcall_info_cache fcc ;
1211
1214
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 ();
1216
1218
1217
1219
if (Z_TYPE (EG (user_exception_handler )) != IS_UNDEF ) {
1218
1220
ZVAL_COPY (return_value , & EG (user_exception_handler ));
0 commit comments