Re: RFC Posted for str_begins and str_ends functions
| From: | Rowan Collins | Date: | Tue, 02 Aug 2016 22:53:08 +0000 |
| Subject: | Re: RFC Posted for str_begins and str_ends functions | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-94807@lists.php.net to get a copy of this message | ||
On 02/08/2016 23:44, Yasuo Ohgaki wrote:
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_iendI think those names mean something different: "str_begin" sounds like an imperative "make this string begin with X"; "str_begins" is more of an assertion "the string begins with X". Ruby would spell it with a ? at the end. It's also the same form, grammatically, as the common "isFoo". Note that this logic holds for "str_replace", which *is* an imperative - you are not saying "tell me if X replaces Y", you are saying "please replace X with Y". Regards, -- Rowan Collins [IMSoP]