diff options
Diffstat (limited to 'ext/standard/string.c')
-rw-r--r-- | ext/standard/string.c | 303 |
1 files changed, 101 insertions, 202 deletions
diff --git a/ext/standard/string.c b/ext/standard/string.c index 1178b08730..5650164bf6 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -69,8 +69,7 @@ #define STR_STRSPN 0 #define STR_STRCSPN 1 -/* {{{ register_string_constants - */ +/* {{{ register_string_constants */ void register_string_constants(INIT_FUNC_ARGS) { REGISTER_LONG_CONSTANT("STR_PAD_LEFT", STR_PAD_LEFT, CONST_CS | CONST_PERSISTENT); @@ -106,8 +105,7 @@ ZEND_SET_ALIGNED(16, static char hexconvtab[]) = "0123456789abcdef"; static MUTEX_T locale_mutex = NULL; #endif -/* {{{ php_bin2hex - */ +/* {{{ php_bin2hex */ static zend_string *php_bin2hex(const unsigned char *old, const size_t oldlen) { zend_string *result; @@ -125,8 +123,7 @@ static zend_string *php_bin2hex(const unsigned char *old, const size_t oldlen) } /* }}} */ -/* {{{ php_hex2bin - */ +/* {{{ php_hex2bin */ static zend_string *php_hex2bin(const unsigned char *old, const size_t oldlen) { size_t target_length = oldlen >> 1; @@ -198,8 +195,7 @@ PHPAPI struct lconv *localeconv_r(struct lconv *out) /* }}} */ #ifdef ZTS -/* {{{ PHP_MINIT_FUNCTION - */ +/* {{{ PHP_MINIT_FUNCTION */ PHP_MINIT_FUNCTION(localeconv) { locale_mutex = tsrm_mutex_alloc(); @@ -207,8 +203,7 @@ PHP_MINIT_FUNCTION(localeconv) } /* }}} */ -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ +/* {{{ PHP_MSHUTDOWN_FUNCTION */ PHP_MSHUTDOWN_FUNCTION(localeconv) { tsrm_mutex_free( locale_mutex ); @@ -218,8 +213,7 @@ PHP_MSHUTDOWN_FUNCTION(localeconv) /* }}} */ #endif -/* {{{ proto string bin2hex(string data) - Converts the binary representation of data to hex */ +/* {{{ Converts the binary representation of data to hex */ PHP_FUNCTION(bin2hex) { zend_string *result; @@ -235,8 +229,7 @@ PHP_FUNCTION(bin2hex) } /* }}} */ -/* {{{ proto string|false hex2bin(string data) - Converts the hex representation of data to binary */ +/* {{{ Converts the hex representation of data to binary */ PHP_FUNCTION(hex2bin) { zend_string *result, *data; @@ -319,16 +312,14 @@ static void php_spn_common_handler(INTERNAL_FUNCTION_PARAMETERS, int behavior) / } /* }}} */ -/* {{{ proto int|false strspn(string str, string mask [, int start [, int len]]) - Finds length of initial segment consisting entirely of characters found in mask. If start or/and length is provided works like strspn(substr($s,$start,$len),$good_chars) */ +/* {{{ Finds length of initial segment consisting entirely of characters found in mask. If start or/and length is provided works like strspn(substr($s,$start,$len),$good_chars) */ PHP_FUNCTION(strspn) { php_spn_common_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU, STR_STRSPN); } /* }}} */ -/* {{{ proto int|false strcspn(string str, string mask [, int start [, int len]]) - Finds length of initial segment consisting entirely of characters not found in mask. If start or/and length is provide works like strcspn(substr($s,$start,$len),$bad_chars) */ +/* {{{ Finds length of initial segment consisting entirely of characters not found in mask. If start or/and length is provide works like strcspn(substr($s,$start,$len),$bad_chars) */ PHP_FUNCTION(strcspn) { php_spn_common_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU, STR_STRCSPN); @@ -505,8 +496,7 @@ PHP_MINIT_FUNCTION(nl_langinfo) } /* }}} */ -/* {{{ proto string|false nl_langinfo(int item) - Query language and locale information */ +/* {{{ Query language and locale information */ PHP_FUNCTION(nl_langinfo) { zend_long item; @@ -692,8 +682,7 @@ PHP_FUNCTION(nl_langinfo) #endif /* }}} */ -/* {{{ proto int strcoll(string str1, string str2) - Compares two strings using the current locale */ +/* {{{ Compares two strings using the current locale */ PHP_FUNCTION(strcoll) { zend_string *s1, *s2; @@ -878,32 +867,28 @@ static zend_always_inline void php_do_trim(INTERNAL_FUNCTION_PARAMETERS, int mod } /* }}} */ -/* {{{ proto string trim(string str [, string character_mask]) - Strips whitespace from the beginning and end of a string */ +/* {{{ Strips whitespace from the beginning and end of a string */ PHP_FUNCTION(trim) { php_do_trim(INTERNAL_FUNCTION_PARAM_PASSTHRU, 3); } /* }}} */ -/* {{{ proto string rtrim(string str [, string character_mask]) - Removes trailing whitespace */ +/* {{{ Removes trailing whitespace */ PHP_FUNCTION(rtrim) { php_do_trim(INTERNAL_FUNCTION_PARAM_PASSTHRU, 2); } /* }}} */ -/* {{{ proto string ltrim(string str [, string character_mask]) - Strips whitespace from the beginning of a string */ +/* {{{ Strips whitespace from the beginning of a string */ PHP_FUNCTION(ltrim) { php_do_trim(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); } /* }}} */ -/* {{{ proto string wordwrap(string str [, int width [, string break [, bool cut]]]) - Wraps buffer to selected number of characters using string break char */ +/* {{{ Wraps buffer to selected number of characters using string break char */ PHP_FUNCTION(wordwrap) { zend_string *text; @@ -1046,8 +1031,7 @@ PHP_FUNCTION(wordwrap) } /* }}} */ -/* {{{ php_explode - */ +/* {{{ php_explode */ PHPAPI void php_explode(const zend_string *delim, zend_string *str, zval *return_value, zend_long limit) { const char *p1 = ZSTR_VAL(str); @@ -1074,8 +1058,7 @@ PHPAPI void php_explode(const zend_string *delim, zend_string *str, zval *return } /* }}} */ -/* {{{ php_explode_negative_limit - */ +/* {{{ php_explode_negative_limit */ PHPAPI void php_explode_negative_limit(const zend_string *delim, zend_string *str, zval *return_value, zend_long limit) { #define EXPLODE_ALLOC_STEP 64 @@ -1116,8 +1099,7 @@ PHPAPI void php_explode_negative_limit(const zend_string *delim, zend_string *st } /* }}} */ -/* {{{ proto array explode(string separator, string str [, int limit]) - Splits a string on string separator and return array of components. If limit is positive only limit number of components is returned. If limit is negative all components except the last abs(limit) are returned. */ +/* {{{ Splits a string on string separator and return array of components. If limit is positive only limit number of components is returned. If limit is negative all components except the last abs(limit) are returned. */ PHP_FUNCTION(explode) { zend_string *str, *delim; @@ -1157,12 +1139,10 @@ PHP_FUNCTION(explode) } /* }}} */ -/* {{{ proto string join([string glue,] array pieces) - An alias for implode */ +/* {{{ An alias for implode */ /* }}} */ -/* {{{ php_implode - */ +/* {{{ php_implode */ PHPAPI void php_implode(const zend_string *glue, HashTable *pieces, zval *return_value) { zval *tmp; @@ -1249,8 +1229,7 @@ PHPAPI void php_implode(const zend_string *glue, HashTable *pieces, zval *return } /* }}} */ -/* {{{ proto string implode([string glue,] array pieces) - Joins array elements placing glue string between items and return one string */ +/* {{{ Joins array elements placing glue string between items and return one string */ PHP_FUNCTION(implode) { zend_string *arg1_str = NULL; @@ -1284,8 +1263,7 @@ PHP_FUNCTION(implode) #define STRTOK_TABLE(p) BG(strtok_table)[(unsigned char) *p] -/* {{{ proto string|false strtok([string str,] string token) - Tokenize a string */ +/* {{{ Tokenize a string */ PHP_FUNCTION(strtok) { zend_string *str, *tok = NULL; @@ -1361,8 +1339,7 @@ restore: } /* }}} */ -/* {{{ php_strtoupper - */ +/* {{{ php_strtoupper */ PHPAPI char *php_strtoupper(char *s, size_t len) { unsigned char *c; @@ -1379,8 +1356,7 @@ PHPAPI char *php_strtoupper(char *s, size_t len) } /* }}} */ -/* {{{ php_string_toupper - */ +/* {{{ php_string_toupper */ PHPAPI zend_string *php_string_toupper(zend_string *s) { unsigned char *c; @@ -1412,8 +1388,7 @@ PHPAPI zend_string *php_string_toupper(zend_string *s) } /* }}} */ -/* {{{ proto string strtoupper(string str) - Makes a string uppercase */ +/* {{{ Makes a string uppercase */ PHP_FUNCTION(strtoupper) { zend_string *arg; @@ -1426,8 +1401,7 @@ PHP_FUNCTION(strtoupper) } /* }}} */ -/* {{{ php_strtolower - */ +/* {{{ php_strtolower */ PHPAPI char *php_strtolower(char *s, size_t len) { unsigned char *c; @@ -1444,8 +1418,7 @@ PHPAPI char *php_strtolower(char *s, size_t len) } /* }}} */ -/* {{{ php_string_tolower - */ +/* {{{ php_string_tolower */ PHPAPI zend_string *php_string_tolower(zend_string *s) { unsigned char *c; @@ -1481,8 +1454,7 @@ PHPAPI zend_string *php_string_tolower(zend_string *s) } /* }}} */ -/* {{{ proto string strtolower(string str) - Makes a string lowercase */ +/* {{{ Makes a string lowercase */ PHP_FUNCTION(strtolower) { zend_string *str; @@ -1495,8 +1467,7 @@ PHP_FUNCTION(strtolower) } /* }}} */ -/* {{{ php_basename - */ +/* {{{ php_basename */ PHPAPI zend_string *php_basename(const char *s, size_t len, const char *suffix, size_t suffix_len) { /* State 0 is directly after a directory separator (or at the start of the string). @@ -1570,8 +1541,7 @@ quit_loop: } /* }}} */ -/* {{{ proto string basename(string path [, string suffix]) - Returns the filename component of the path */ +/* {{{ Returns the filename component of the path */ PHP_FUNCTION(basename) { char *string, *suffix = NULL; @@ -1595,8 +1565,7 @@ PHPAPI size_t php_dirname(char *path, size_t len) } /* }}} */ -/* {{{ proto string dirname(string path[, int levels]) - Returns the directory name component of the path */ +/* {{{ Returns the directory name component of the path */ PHP_FUNCTION(dirname) { char *str; @@ -1638,8 +1607,7 @@ PHP_FUNCTION(dirname) } /* }}} */ -/* {{{ proto array|string pathinfo(string path[, int options]) - Returns information about a certain string */ +/* {{{ Returns information about a certain string */ PHP_FUNCTION(pathinfo) { zval tmp; @@ -1732,8 +1700,7 @@ PHPAPI char *php_stristr(char *s, char *t, size_t s_len, size_t t_len) } /* }}} */ -/* {{{ php_strspn - */ +/* {{{ php_strspn */ PHPAPI size_t php_strspn(const char *s1, const char *s2, const char *s1_end, const char *s2_end) { register const char *p = s1, *spanp; @@ -1750,8 +1717,7 @@ cont: } /* }}} */ -/* {{{ php_strcspn - */ +/* {{{ php_strcspn */ PHPAPI size_t php_strcspn(const char *s1, const char *s2, const char *s1_end, const char *s2_end) { register const char *p, *spanp; @@ -1770,8 +1736,7 @@ PHPAPI size_t php_strcspn(const char *s1, const char *s2, const char *s1_end, co } /* }}} */ -/* {{{ proto string|false stristr(string haystack, string needle[, bool part]) - Finds first occurrence of a string within another, case insensitive */ +/* {{{ Finds first occurrence of a string within another, case insensitive */ PHP_FUNCTION(stristr) { zend_string *haystack, *needle; @@ -1808,8 +1773,7 @@ PHP_FUNCTION(stristr) } /* }}} */ -/* {{{ proto string|false strstr(string haystack, string needle[, bool part]) - Finds first occurrence of a string within another */ +/* {{{ Finds first occurrence of a string within another */ PHP_FUNCTION(strstr) { zend_string *haystack, *needle; @@ -1838,8 +1802,7 @@ PHP_FUNCTION(strstr) } /* }}} */ -/* {{{ proto bool str_contains(string haystack, string needle) - Checks if a string contains another */ +/* {{{ Checks if a string contains another */ PHP_FUNCTION(str_contains) { zend_string *haystack, *needle; @@ -1853,8 +1816,7 @@ PHP_FUNCTION(str_contains) } /* }}} */ -/* {{{ proto bool str_starts_with(string haystack, string needle) - Checks if haystack starts with needle */ +/* {{{ Checks if haystack starts with needle */ PHP_FUNCTION(str_starts_with) { zend_string *haystack, *needle; @@ -1872,8 +1834,7 @@ PHP_FUNCTION(str_starts_with) } /* }}} */ -/* {{{ proto bool str_ends_with(string haystack, string needle) - Checks if haystack ends with needle */ +/* {{{ Checks if haystack ends with needle */ PHP_FUNCTION(str_ends_with) { zend_string *haystack, *needle; @@ -1893,12 +1854,10 @@ PHP_FUNCTION(str_ends_with) } /* }}} */ -/* {{{ proto string strchr(string haystack, string needle) - An alias for strstr */ +/* {{{ An alias for strstr */ /* }}} */ -/* {{{ proto int|false strpos(string haystack, string needle [, int offset]) - Finds position of first occurrence of a string within another */ +/* {{{ Finds position of first occurrence of a string within another */ PHP_FUNCTION(strpos) { zend_string *haystack, *needle; @@ -1932,8 +1891,7 @@ PHP_FUNCTION(strpos) } /* }}} */ -/* {{{ proto int|false stripos(string haystack, string needle [, int offset]) - Finds position of first occurrence of a string within another, case insensitive */ +/* {{{ Finds position of first occurrence of a string within another, case insensitive */ PHP_FUNCTION(stripos) { const char *found = NULL; @@ -1976,8 +1934,7 @@ PHP_FUNCTION(stripos) } /* }}} */ -/* {{{ proto int|false strrpos(string haystack, string needle [, int offset]) - Finds position of last occurrence of a string within another string */ +/* {{{ Finds position of last occurrence of a string within another string */ PHP_FUNCTION(strrpos) { zend_string *needle; @@ -2021,8 +1978,7 @@ PHP_FUNCTION(strrpos) } /* }}} */ -/* {{{ proto int|false strripos(string haystack, string needle [, int offset]) - Finds position of last occurrence of a string within another string */ +/* {{{ Finds position of last occurrence of a string within another string */ PHP_FUNCTION(strripos) { zend_string *needle; @@ -2105,8 +2061,7 @@ PHP_FUNCTION(strripos) } /* }}} */ -/* {{{ proto string|false strrchr(string haystack, string needle) - Finds the last occurrence of a character in a string within another */ +/* {{{ Finds the last occurrence of a character in a string within another */ PHP_FUNCTION(strrchr) { zend_string *haystack, *needle; @@ -2128,8 +2083,7 @@ PHP_FUNCTION(strrchr) } /* }}} */ -/* {{{ php_chunk_split - */ +/* {{{ php_chunk_split */ static zend_string *php_chunk_split(const char *src, size_t srclen, const char *end, size_t endlen, size_t chunklen) { char *q; @@ -2170,8 +2124,7 @@ static zend_string *php_chunk_split(const char *src, size_t srclen, const char * } /* }}} */ -/* {{{ proto string chunk_split(string str [, int chunklen [, string ending]]) - Returns split line */ +/* {{{ Returns split line */ PHP_FUNCTION(chunk_split) { zend_string *str; @@ -2211,8 +2164,7 @@ PHP_FUNCTION(chunk_split) } /* }}} */ -/* {{{ proto string|false substr(string str, int start [, int length]) - Returns part of a string */ +/* {{{ Returns part of a string */ PHP_FUNCTION(substr) { zend_string *str; @@ -2283,8 +2235,7 @@ truncate_len: } /* }}} */ -/* {{{ proto string|array|false substr_replace(mixed str, mixed repl, mixed start [, mixed length]) - Replaces part of a string with another string */ +/* {{{ Replaces part of a string with another string */ PHP_FUNCTION(substr_replace) { zend_string *str, *repl_str; @@ -2538,8 +2489,7 @@ PHP_FUNCTION(substr_replace) } /* }}} */ -/* {{{ proto string quotemeta(string str) - Quotes meta characters */ +/* {{{ Quotes meta characters */ PHP_FUNCTION(quotemeta) { zend_string *old; @@ -2587,8 +2537,7 @@ PHP_FUNCTION(quotemeta) } /* }}} */ -/* {{{ proto int ord(string character) - Returns ASCII value of character +/* {{{ Returns ASCII value of character Warning: This function is special-cased by zend_compile.c and so is bypassed for constant string argument */ PHP_FUNCTION(ord) { @@ -2602,8 +2551,7 @@ PHP_FUNCTION(ord) } /* }}} */ -/* {{{ proto string chr(int ascii) - Converts ASCII code to a character +/* {{{ Converts ASCII code to a character Warning: This function is special-cased by zend_compile.c and so is bypassed for constant integer argument */ PHP_FUNCTION(chr) { @@ -2633,8 +2581,7 @@ static zend_string* php_ucfirst(zend_string *str) } /* }}} */ -/* {{{ proto string ucfirst(string str) - Makes a string's first character uppercase */ +/* {{{ Makes a string's first character uppercase */ PHP_FUNCTION(ucfirst) { zend_string *str; @@ -2666,8 +2613,7 @@ static zend_string* php_lcfirst(zend_string *str) } /* }}} */ -/* {{{ proto string lcfirst(string str) - Make a string's first character lowercase */ +/* {{{ Make a string's first character lowercase */ PHP_FUNCTION(lcfirst) { zend_string *str; @@ -2684,8 +2630,7 @@ PHP_FUNCTION(lcfirst) } /* }}} */ -/* {{{ proto string ucwords(string str [, string delims]) - Uppercase the first character of every word in a string */ +/* {{{ Uppercase the first character of every word in a string */ PHP_FUNCTION(ucwords) { zend_string *str; @@ -2719,8 +2664,7 @@ PHP_FUNCTION(ucwords) } /* }}} */ -/* {{{ php_strtr - */ +/* {{{ php_strtr */ PHPAPI char *php_strtr(char *str, size_t len, const char *str_from, const char *str_to, size_t trlen) { size_t i; @@ -2754,8 +2698,7 @@ PHPAPI char *php_strtr(char *str, size_t len, const char *str_from, const char * } /* }}} */ -/* {{{ php_strtr_ex - */ +/* {{{ php_strtr_ex */ static zend_string *php_strtr_ex(zend_string *str, const char *str_from, const char *str_to, size_t trlen) { zend_string *new_str = NULL; @@ -2948,8 +2891,7 @@ static void php_strtr_array(zval *return_value, zend_string *input, HashTable *p } /* }}} */ -/* {{{ php_char_to_str_ex - */ +/* {{{ php_char_to_str_ex */ static zend_string* php_char_to_str_ex(zend_string *str, char from, char *to, size_t to_len, int case_sensitivity, zend_long *replace_count) { zend_string *result; @@ -3020,8 +2962,7 @@ static zend_string* php_char_to_str_ex(zend_string *str, char from, char *to, si } /* }}} */ -/* {{{ php_str_to_str_ex - */ +/* {{{ php_str_to_str_ex */ static zend_string *php_str_to_str_ex(zend_string *haystack, const char *needle, size_t needle_len, const char *str, size_t str_len, zend_long *replace_count) { @@ -3094,8 +3035,7 @@ nothing_todo: } /* }}} */ -/* {{{ php_str_to_str_i_ex - */ +/* {{{ php_str_to_str_i_ex */ static zend_string *php_str_to_str_i_ex(zend_string *haystack, const char *lc_haystack, zend_string *needle, const char *str, size_t str_len, zend_long *replace_count) { @@ -3189,8 +3129,7 @@ nothing_todo: } /* }}} */ -/* {{{ php_str_to_str - */ +/* {{{ php_str_to_str */ PHPAPI zend_string *php_str_to_str(const char *haystack, size_t length, const char *needle, size_t needle_len, const char *str, size_t str_len) { zend_string *new_str; @@ -3262,8 +3201,7 @@ PHPAPI zend_string *php_str_to_str(const char *haystack, size_t length, const ch } /* }}} */ -/* {{{ proto string|false strtr(string str, string from[, string to]) - Translates characters in str using given translation tables */ +/* {{{ Translates characters in str using given translation tables */ PHP_FUNCTION(strtr) { zend_string *str, *from_str = NULL; @@ -3338,8 +3276,7 @@ PHP_FUNCTION(strtr) } /* }}} */ -/* {{{ proto string strrev(string str) - Reverse a string */ +/* {{{ Reverse a string */ #if ZEND_INTRIN_SSSE3_NATIVE #include <tmmintrin.h> #elif defined(__aarch64__) @@ -3400,8 +3337,7 @@ PHP_FUNCTION(strrev) } /* }}} */ -/* {{{ php_similar_str - */ +/* {{{ php_similar_str */ static void php_similar_str(const char *txt1, size_t len1, const char *txt2, size_t len2, size_t *pos1, size_t *pos2, size_t *max, size_t *count) { const char *p, *q; @@ -3425,8 +3361,7 @@ static void php_similar_str(const char *txt1, size_t len1, const char *txt2, siz } /* }}} */ -/* {{{ php_similar_char - */ +/* {{{ php_similar_char */ static size_t php_similar_char(const char *txt1, size_t len1, const char *txt2, size_t len2) { size_t sum; @@ -3448,8 +3383,7 @@ static size_t php_similar_char(const char *txt1, size_t len1, const char *txt2, } /* }}} */ -/* {{{ proto int similar_text(string str1, string str2 [, float percent]) - Calculates the similarity between two strings */ +/* {{{ Calculates the similarity between two strings */ PHP_FUNCTION(similar_text) { zend_string *t1, *t2; @@ -3482,8 +3416,7 @@ PHP_FUNCTION(similar_text) } /* }}} */ -/* {{{ proto string addcslashes(string str, string charlist) - Escapes all chars mentioned in charlist with backslash. It creates octal representations if asked to backslash characters with 8th bit set or with ASCII<32 (except '\n', '\r', '\t' etc...) */ +/* {{{ Escapes all chars mentioned in charlist with backslash. It creates octal representations if asked to backslash characters with 8th bit set or with ASCII<32 (except '\n', '\r', '\t' etc...) */ PHP_FUNCTION(addcslashes) { zend_string *str, *what; @@ -3505,8 +3438,7 @@ PHP_FUNCTION(addcslashes) } /* }}} */ -/* {{{ proto string addslashes(string str) - Escapes single quote, double quotes and backslash characters in a string with backslashes */ +/* {{{ Escapes single quote, double quotes and backslash characters in a string with backslashes */ PHP_FUNCTION(addslashes) { zend_string *str; @@ -3523,8 +3455,7 @@ PHP_FUNCTION(addslashes) } /* }}} */ -/* {{{ proto string stripcslashes(string str) - Strips backslashes from a string. Uses C-style conventions */ +/* {{{ Strips backslashes from a string. Uses C-style conventions */ PHP_FUNCTION(stripcslashes) { zend_string *str; @@ -3538,8 +3469,7 @@ PHP_FUNCTION(stripcslashes) } /* }}} */ -/* {{{ proto string stripslashes(string str) - Strips backslashes from a string */ +/* {{{ Strips backslashes from a string */ PHP_FUNCTION(stripslashes) { zend_string *str; @@ -3553,8 +3483,7 @@ PHP_FUNCTION(stripslashes) } /* }}} */ -/* {{{ php_stripcslashes - */ +/* {{{ php_stripcslashes */ PHPAPI void php_stripcslashes(zend_string *str) { const char *source, *end; @@ -3617,8 +3546,7 @@ PHPAPI void php_stripcslashes(zend_string *str) } /* }}} */ -/* {{{ php_addcslashes_str - */ +/* {{{ php_addcslashes_str */ PHPAPI zend_string *php_addcslashes_str(const char *str, size_t len, const char *what, size_t wlength) { char flags[256]; @@ -3660,8 +3588,7 @@ PHPAPI zend_string *php_addcslashes_str(const char *str, size_t len, const char } /* }}} */ -/* {{{ php_addcslashes - */ +/* {{{ php_addcslashes */ PHPAPI zend_string *php_addcslashes(zend_string *str, const char *what, size_t wlength) { return php_addcslashes_str(ZSTR_VAL(str), ZSTR_LEN(str), what, wlength); @@ -3720,8 +3647,7 @@ PHPAPI void php_stripslashes(zend_string *str) { php_stripslashes_ptr(str); } -/* {{{ PHP_MINIT_FUNCTION - */ +/* {{{ PHP_MINIT_FUNCTION */ PHP_MINIT_FUNCTION(string_intrin) { if (zend_cpu_supports(ZEND_CPU_FEATURE_SSE42)) { @@ -4160,8 +4086,7 @@ PHPAPI void php_stripslashes(zend_string *str) #define _isblank(c) (((((unsigned char) c) == ' ' || ((unsigned char) c) == '\t')) ? 1 : 0) #define _isnewline(c) (((((unsigned char) c) == '\n' || ((unsigned char) c) == '\r')) ? 1 : 0) -/* {{{ php_str_replace_in_subject - */ +/* {{{ php_str_replace_in_subject */ static zend_long php_str_replace_in_subject(zval *search, zval *replace, zend_string *subject_str, zval *result, int case_sensitivity) { zval *search_entry, @@ -4317,8 +4242,7 @@ static zend_long php_str_replace_in_subject(zval *search, zval *replace, zend_st } /* }}} */ -/* {{{ php_str_replace_common - */ +/* {{{ php_str_replace_common */ static void php_str_replace_common(INTERNAL_FUNCTION_PARAMETERS, int case_sensitivity) { zend_string *subject_str; @@ -4381,24 +4305,21 @@ static void php_str_replace_common(INTERNAL_FUNCTION_PARAMETERS, int case_sensit } /* }}} */ -/* {{{ proto mixed str_replace(mixed search, mixed replace, mixed subject [, int &replace_count]) - Replaces all occurrences of search in haystack with replace */ +/* {{{ Replaces all occurrences of search in haystack with replace */ PHP_FUNCTION(str_replace) { php_str_replace_common(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); } /* }}} */ -/* {{{ proto mixed str_ireplace(mixed search, mixed replace, mixed subject [, int &replace_count]) - Replaces all occurrences of search in haystack with replace / case-insensitive */ +/* {{{ Replaces all occurrences of search in haystack with replace / case-insensitive */ PHP_FUNCTION(str_ireplace) { php_str_replace_common(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); } /* }}} */ -/* {{{ proto string hebrev(string str [, int max_chars_per_line]) - Converts logical Hebrew text to visual text */ +/* {{{ Converts logical Hebrew text to visual text */ PHP_FUNCTION(hebrev) { char *str, *heb_str, *target; @@ -4563,8 +4484,7 @@ PHP_FUNCTION(hebrev) } /* }}} */ -/* {{{ proto string nl2br(string str [, bool is_xhtml]) - Converts newlines to HTML line breaks */ +/* {{{ Converts newlines to HTML line breaks */ PHP_FUNCTION(nl2br) { /* in brief this inserts <br /> or <br> before matched regexp \n\r?|\r\n? */ @@ -4646,8 +4566,7 @@ PHP_FUNCTION(nl2br) } /* }}} */ -/* {{{ proto string strip_tags(string str [, string allowable_tags]) - Strips HTML and PHP tags from a string */ +/* {{{ Strips HTML and PHP tags from a string */ PHP_FUNCTION(strip_tags) { zend_string *buf; @@ -4695,8 +4614,7 @@ PHP_FUNCTION(strip_tags) } /* }}} */ -/* {{{ proto string|false setlocale(int category, string locale [, string ...]) - Set locale information */ +/* {{{ Set locale information */ PHP_FUNCTION(setlocale) { zval *args = NULL; @@ -4813,8 +4731,7 @@ PHP_FUNCTION(setlocale) } /* }}} */ -/* {{{ proto void parse_str(string encoded_string, array &result) - Parses GET/POST/COOKIE data and sets global variables */ +/* {{{ Parses GET/POST/COOKIE data and sets global variables */ PHP_FUNCTION(parse_str) { char *arg; @@ -5253,8 +5170,7 @@ finish: } /* }}} */ -/* {{{ proto array str_getcsv(string input[, string delimiter[, string enclosure[, string escape]]]) -Parse a CSV string into an array */ +/* {{{ Parse a CSV string into an array */ PHP_FUNCTION(str_getcsv) { zend_string *str; @@ -5281,8 +5197,7 @@ PHP_FUNCTION(str_getcsv) } /* }}} */ -/* {{{ proto string str_repeat(string input, int mult) - Returns the input string repeat mult times */ +/* {{{ Returns the input string repeat mult times */ PHP_FUNCTION(str_repeat) { zend_string *input_str; /* Input string */ @@ -5334,8 +5249,7 @@ PHP_FUNCTION(str_repeat) } /* }}} */ -/* {{{ proto array|string count_chars(string input [, int mode]) - Returns info about what characters are used in input */ +/* {{{ Returns info about what characters are used in input */ PHP_FUNCTION(count_chars) { zend_string *input; @@ -5405,8 +5319,7 @@ PHP_FUNCTION(count_chars) } /* }}} */ -/* {{{ php_strnatcmp - */ +/* {{{ php_strnatcmp */ static void php_strnatcmp(INTERNAL_FUNCTION_PARAMETERS, int fold_case) { zend_string *s1, *s2; @@ -5448,16 +5361,14 @@ PHPAPI int string_natural_compare_function(zval *result, zval *op1, zval *op2) / } /* }}} */ -/* {{{ proto int strnatcmp(string s1, string s2) - Returns the result of string comparison using 'natural' algorithm */ +/* {{{ Returns the result of string comparison using 'natural' algorithm */ PHP_FUNCTION(strnatcmp) { php_strnatcmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); } /* }}} */ -/* {{{ proto array localeconv(void) - Returns numeric formatting information based on the current locale */ +/* {{{ Returns numeric formatting information based on the current locale */ PHP_FUNCTION(localeconv) { zval grouping, mon_grouping; @@ -5511,16 +5422,14 @@ PHP_FUNCTION(localeconv) } /* }}} */ -/* {{{ proto int strnatcasecmp(string s1, string s2) - Returns the result of case-insensitive string comparison using 'natural' algorithm */ +/* {{{ Returns the result of case-insensitive string comparison using 'natural' algorithm */ PHP_FUNCTION(strnatcasecmp) { php_strnatcmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); } /* }}} */ -/* {{{ proto int|false substr_count(string haystack, string needle [, int offset [, int length]]) - Returns the number of times a substring occurs in the string */ +/* {{{ Returns the number of times a substring occurs in the string */ PHP_FUNCTION(substr_count) { char *haystack, *needle; @@ -5586,8 +5495,7 @@ PHP_FUNCTION(substr_count) } /* }}} */ -/* {{{ proto string str_pad(string input, int pad_length [, string pad_string [, int pad_type]]) - Returns input string padded on the left or right to specified length with pad_string */ +/* {{{ Returns input string padded on the left or right to specified length with pad_string */ PHP_FUNCTION(str_pad) { /* Input arguments */ @@ -5666,8 +5574,7 @@ PHP_FUNCTION(str_pad) } /* }}} */ -/* {{{ proto array|int|null sscanf(string str, string format [, string ...]) - Implements an ANSI C compatible sscanf */ +/* {{{ Implements an ANSI C compatible sscanf */ PHP_FUNCTION(sscanf) { zval *args = NULL; @@ -5785,8 +5692,7 @@ static zend_string *php_str_rot13(zend_string *str) } /* }}} */ -/* {{{ proto string str_rot13(string str) - Perform the rot13 transform on a string */ +/* {{{ Perform the rot13 transform on a string */ PHP_FUNCTION(str_rot13) { zend_string *arg; @@ -5824,8 +5730,7 @@ static void php_string_shuffle(char *str, zend_long len) /* {{{ */ } /* }}} */ -/* {{{ proto string str_shuffle(string str) - Shuffles string. One permutation of all possible is created */ +/* {{{ Shuffles string. One permutation of all possible is created */ PHP_FUNCTION(str_shuffle) { zend_string *arg; @@ -5841,8 +5746,7 @@ PHP_FUNCTION(str_shuffle) } /* }}} */ -/* {{{ proto array|int str_word_count(string str, [int format [, string charlist]]) - Counts the number of words inside a string. If format of 1 is specified, +/* {{{ Counts the number of words inside a string. If format of 1 is specified, then the function will return an array containing all the words found inside the string. If format of 2 is specified, then the function will return an associated array where the position of the word is the key @@ -5930,8 +5834,7 @@ PHP_FUNCTION(str_word_count) /* }}} */ -/* {{{ proto array str_split(string str [, int split_length]) - Convert a string to an array. If split_length is specified, break the string down into chunks each split_length characters long. */ +/* {{{ Convert a string to an array. If split_length is specified, break the string down into chunks each split_length characters long. */ PHP_FUNCTION(str_split) { zend_string *str; @@ -5972,8 +5875,7 @@ PHP_FUNCTION(str_split) } /* }}} */ -/* {{{ proto string|false strpbrk(string haystack, string char_list) - Search a string for any of a set of characters */ +/* {{{ Search a string for any of a set of characters */ PHP_FUNCTION(strpbrk) { zend_string *haystack, *char_list; @@ -6001,8 +5903,7 @@ PHP_FUNCTION(strpbrk) } /* }}} */ -/* {{{ proto int|false substr_compare(string main_str, string str, int offset [, int length [, bool case_sensitivity]]) - Binary safe optionally case insensitive comparison of 2 strings from an offset, up to length characters */ +/* {{{ Binary safe optionally case insensitive comparison of 2 strings from an offset, up to length characters */ PHP_FUNCTION(substr_compare) { zend_string *s1, *s2; @@ -6110,8 +6011,7 @@ static zend_string *php_utf8_decode(const char *s, size_t len) } /* }}} */ -/* {{{ proto string utf8_encode(string data) - Encodes an ISO-8859-1 string to UTF-8 */ +/* {{{ Encodes an ISO-8859-1 string to UTF-8 */ PHP_FUNCTION(utf8_encode) { char *arg; @@ -6125,8 +6025,7 @@ PHP_FUNCTION(utf8_encode) } /* }}} */ -/* {{{ proto string utf8_decode(string data) - Converts a UTF-8 encoded string to ISO-8859-1 */ +/* {{{ Converts a UTF-8 encoded string to ISO-8859-1 */ PHP_FUNCTION(utf8_decode) { char *arg; |