@@ -2953,22 +2953,7 @@ PHP_FUNCTION(mb_strtolower)
2953
2953
RETURN_STR (mbstring_convert_case (PHP_UNICODE_CASE_LOWER , ZSTR_VAL (str ), ZSTR_LEN (str ), enc ));
2954
2954
}
2955
2955
2956
- static zend_string * php_mb_ulcfirst (zend_string * str , php_case_mode mode , const mbfl_encoding * enc )
2957
- {
2958
- zend_string * first , * second , * head ;
2959
- first = mb_get_substr (str , 0 , 1 , enc );
2960
- second = mb_get_substr (str , 1 , MBFL_SUBSTR_UNTIL_END , enc );
2961
- head = mbstring_convert_case (mode , ZSTR_VAL (first ), ZSTR_LEN (first ), enc );
2962
- zend_string_release_ex (first , false);
2963
-
2964
- zend_string * retval = zend_string_concat2 (ZSTR_VAL (head ), ZSTR_LEN (head ), ZSTR_VAL (second ), ZSTR_LEN (second ));
2965
- zend_string_release_ex (head , false);
2966
- zend_string_release_ex (second , false);
2967
-
2968
- return retval ;
2969
- }
2970
-
2971
- PHP_FUNCTION (mb_ucfirst )
2956
+ static void php_mb_ulcfirst (INTERNAL_FUNCTION_PARAMETERS , php_case_mode mode )
2972
2957
{
2973
2958
zend_string * str , * from_encoding = NULL ;
2974
2959
@@ -2983,25 +2968,26 @@ PHP_FUNCTION(mb_ucfirst)
2983
2968
RETURN_THROWS ();
2984
2969
}
2985
2970
2986
- RETVAL_STR (php_mb_ulcfirst (str , PHP_UNICODE_CASE_TITLE , enc ));
2987
- }
2971
+ zend_string * first = mb_get_substr (str , 0 , 1 , enc );
2972
+ zend_string * second = mb_get_substr (str , 1 , MBFL_SUBSTR_UNTIL_END , enc );
2973
+ zend_string * head = mbstring_convert_case (mode , ZSTR_VAL (first ), ZSTR_LEN (first ), enc );
2974
+ zend_string_release_ex (first , false);
2988
2975
2989
- PHP_FUNCTION ( mb_lcfirst )
2990
- {
2991
- zend_string * str , * from_encoding = NULL ;
2976
+ zend_string * retval = zend_string_concat2 ( ZSTR_VAL ( head ), ZSTR_LEN ( head ), ZSTR_VAL ( second ), ZSTR_LEN ( second ));
2977
+ zend_string_release_ex ( head , false);
2978
+ zend_string_release_ex ( second , false) ;
2992
2979
2993
- ZEND_PARSE_PARAMETERS_START (1 , 2 )
2994
- Z_PARAM_STR (str )
2995
- Z_PARAM_OPTIONAL
2996
- Z_PARAM_STR_OR_NULL (from_encoding )
2997
- ZEND_PARSE_PARAMETERS_END ();
2980
+ RETVAL_STR (retval );
2981
+ }
2998
2982
2999
- const mbfl_encoding * enc = php_mb_get_encoding ( from_encoding , 2 );
3000
- if (! enc ) {
3001
- RETURN_THROWS ( );
3002
- }
2983
+ PHP_FUNCTION ( mb_ucfirst )
2984
+ {
2985
+ php_mb_ulcfirst ( INTERNAL_FUNCTION_PARAM_PASSTHRU , PHP_UNICODE_CASE_TITLE );
2986
+ }
3003
2987
3004
- RETVAL_STR (php_mb_ulcfirst (str , PHP_UNICODE_CASE_LOWER , enc ));
2988
+ PHP_FUNCTION (mb_lcfirst )
2989
+ {
2990
+ php_mb_ulcfirst (INTERNAL_FUNCTION_PARAM_PASSTHRU , PHP_UNICODE_CASE_LOWER );
3005
2991
}
3006
2992
3007
2993
typedef enum {
0 commit comments