> On 2/08/2016, at 8:52 AM, w...@wkhudgins.info wrote:
> 
> Hello,
> 
> I recently emailed the group about submitting an RFC for str_begins() and 
> str_ends() functions. The RFC has now been officially submitted and is 
> viewable at:
> 
> https://wiki.php.net/rfc/add_str_begin_and_end_functions
> 
> The github PR may be found at:
> 
> https://github.com/php/php-src/pull/2049
> 
> Hope to be hearing about this,
> 
> Will

Firstly, the argument ordering is the wrong way round for a string function. 
String functions — especially search-related ones — are haystack, needle (see 
strpos, strstr, strcspn, strpbrk, etc).

Secondly, I feel like this RFC does need to include that it’s a BC break by 
introducing new global functions. A quick search shows that SugarCRM[1] already 
implements str_begin and str_end functions and there’s likely to be other 
projects that do too.

[1]: 
https://github.com/sugarcrm/sugarcrm_dev/blob/ae189cfa4ed4edd6a4e1e0d9d1d5ec66f46a0b74/include/utils.php#L2082-L2090
--
Simon Welsh


Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to