Hi David, On Tue, Aug 2, 2016 at 10:36 AM, David Rodrigues <david.pro...@gmail.com> wrote: > Sara Golemon wrote: >> Feeling "meh" on it (neither for nor against), but I would consider >> consistency with other str*() functions by making case-insensitivity >> live in separate functions rather than as a parameter. e.g. >> str_begins(), str_ibegins(), str_ends(), end_iends() > > I guess that "i" isn't appliable when it have slashes. > In this case, functions should be: strbegins, stribegins, strends, striends. > In all case, I think that is better a third parameter and keep underlined.
This is difficult issue. String function names are inconsistent currently. It is better to stick to CODING_STANDARDS naming convention for new function names. Therefore, new string functions are better to be named str_*() unless they are too strange. e.g. http://php.net/manual/en/function.str-replace.php http://php.net/manual/en/function.str-ireplace.php I would like to fix function name inconsistencies by having aliases in near future. https://wiki.php.net/rfc/consistent_function_names It might be okay to have "s" in function names, but if we want to be consistent, str_replace -> str_replaces str_ireplace -> str_ireplaces IMO, following names are better for consistency. str_begin str_ibegin str_end str_iend In addition, str_replace() has seach_value at first, so signature might be boolean str_begin(string $search_value, string $str, [boolean $case_sensitive = true]) boolean str_end(string $search_value, string $str, string $search_value [boolean $case_sensitive = true]) However, strstr() (and other str functions without "_". e.g. strpos/stripos/strrpos/strripos) has search_value as the 2nd parameter. If we follow this format, current signature is fine. It may be better sort out and fix consistency issues first, then add new functions. Otherwise, we may introduce more consistency issues. Regards, BTW, having "i" is more readable. str_ibegin("searchthis", $str); is more readable than str_begin("seachthis", $str, TRUE); as programmer does not have to know that's the TRUE means. It's small thing, but small things add up. -- Yasuo Ohgaki yohg...@ohgaki.net -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php