rfc:implement-strrstr-for-consistency

This is an old revision of the document!


PHP RFC: Implement strrstr counterpart to strstr for consistency

Introduction

Implement strrstr (and possibly strristr) for consistency with other string functions

Proposal

Currently there exist no “proper” counter par to the strstr (and stristr) standard string function. There exist strrchr however it does not have the same signature as strstr nor strchr as strchr is an alias of strstr, nor does it provide the same features.

Pros

* Consistency within the standard library * Feature built-in to the language

Cons

* More “bloat” in the global namespace * Follows an old naming scheme * Adds a function alias to the language * Easely implemented in userland

Backward Incompatible Changes

None

Proposed PHP Version(s)

Next minor i.e. PHP 7.4.

Open Issues

How to handle the newly created alias.

Unaffected PHP Functionality

List existing areas/features of PHP that will not be changed by the RFC.

This helps avoid any ambiguity, shows that you have thought deeply about the RFC's impact, and helps reduces mail list noise.

Proposed Voting Choices

2/3 Majority for adding strrstr (and possibly strristr after discussion).

Patches and Tests

Links to any external patches and tests go here.

If there is no patch, make it clear who will create a patch, or whether a volunteer to help with implementation is needed.

Make it clear if the patch is intended to be the final patch, or is just a prototype.

For changes affecting the core language, you should also provide a patch for the language specification.

Implementation

After the project is implemented, this section should contain

  1. the version(s) it was merged into
  2. a link to the git commit(s)
  3. a link to the PHP manual entry for the feature
  4. a link to the language specification section (if any)

References

Links to external references, discussions or RFCs

Rejected Features

Keep this updated with features that were discussed on the mail lists.

rfc/implement-strrstr-for-consistency.1560998172.txt.gz · Last modified: 2019/06/20 02:36 by girgias