Re: Direction for the Function Renaming Effort
| From: | Cynic | Date: | Wed, 07 Feb 2001 12:33:04 +0000 |
| Subject: | Re: Direction for the Function Renaming Effort | ||
| References: | 1 2 3 4 5 | Groups: | php.qa |
| Request: | Send a blank email to php-qa+get-2269@lists.php.net to get a copy of this message | ||
(Prefix: Again, what is the impact--performace-wise--of many
PHP_FALIAS()es? Is something like --enable-strict-names /
--enable-strict-names-only viable?)
At 12:40 7.2. 2001, André Langhorst wrote the following:
--------------------------------------------------------------
>[+1] for creating a list with string functions which should *NOT* aliased and renamed
I'm afraid this would be shooting the effort in the leg.
We should think the opposite way.
>str_ group:
>str_implode -- Join array elements with a string
>str_join -- Join array elements with a string
>str_levenshtein -- Calculate Levenshtein distance between two strings
>str_locale_conv -- Get numeric formatting information
>str_md5 -- Calculate the md5 hash of a string
>str_Metaphone -- Calculate the metaphone key of a string
>str_nl2br -- Converts newlines to HTML line breaks
what about str_nlbr (like dechex) or str_nltobr (like strtolower) or even
str_nl_to_br? (I don't like this one). this should be resolved too.
This is a sub-issue, but from my POV it's very important to
have a scheme for this too.
>str_parse -- Parses the string into variables
>str_quoted_printable_decode -- Convert a quoted-printable string to an 8 bit string
>str_quote_meta -- Quote meta characters
>str_set_locale -- Set locale information
>str_similar_text -- Calculate the similarity between two strings
>
>exceptions:
>print -- Output a string
>printf -- Output a formatted string
>sscanf -- Parses input from a string according to a format
ok, but then again, I can understand if someone feels it should be
str_print. On the other hand, you can print() a boolean or a double...
var_print()? You can print a constant... So I'd stick with just print().
>str group
>strrpos -- Find position of last occurrence of a char in a string
>strspn -- Find length of initial segment matching mask
>strstr -- Find first occurrence of a string
>strtok -- Tokenize string
what's wrong with str_rpos?
>dunno, maybe exceptions?:
>Ord -- Return ASCII value of character
>rtrim -- Remove trailing whitespace.
str_rtrim might look strange or crippled, but that is the case with
most of the functions. Virtually everybody will have their favorite
function, and they'll feel "offended" if it changes -- because
"booo, strtok's been strtok for years in C, what's that str_tok shit?"
____________________________________________________________
Cynic:
A member of a group of ancient Greek philosophers who taught
that virtue constitutes happiness and that self control is
the essential part of virtue.
cynic@mail.cz