rfc:implement-strrstr-for-consistency

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
rfc:implement-strrstr-for-consistency [2019/06/20 02:36] – created girgiasrfc:implement-strrstr-for-consistency [2019/07/03 10:11] (current) girgias
Line 3: Line 3:
   * Date: 2019-06-20   * Date: 2019-06-20
   * Author: George Peter Banyard <girgias@php.net>   * Author: George Peter Banyard <girgias@php.net>
-  * Status: Draft+  * Status: Withdrawn (2019-07-03) 
   * First Published at: http://wiki.php.net/rfc/implement-strrstr-for-consistency   * First Published at: http://wiki.php.net/rfc/implement-strrstr-for-consistency
  
 ===== Introduction ===== ===== Introduction =====
-Implement strrstr (and possibly strristr) for consistency with other string functions+Implement <php>strrstr</php> (and possibly <php>strristr</php>) for consistency with the <php>strpos</php> string functions family. 
 + 
 + 
 +Currently there exist no "proper" counter part to the <php>strstr</php> (and <php>stristr</php>) standard string function. 
 +There exist <php>strrchr</php> however it does not have the same signature as <php>strstr</php> nor <php>strchr</php> as <php>strchr</php> is an alias of <php>strstr</php>, nor does it provide the same features.
  
 ===== Proposal ===== ===== Proposal =====
-Currently there exist no "proper" counter par to the strstr (and stristrstandard string function. +Implement <php>strrstr</php> and <php>strristr</php> (?in PHP 7.4 with the same features as <php>strstr</php>meaning that the ''$needle'' parameter can accept multiple characters and add a boolean parameter ''$before_needle'' which has a default value of <php>false</php>. 
-There exist strrchr however it does not have the same signature as strstr nor strchr as strchr is an alias of strstrnor does it provide the same features.+
  
 ===== Pros ===== ===== Pros =====
- * Consistency within the standard library +  * Consistency within the standard library 
- * Feature built-in to the language+  * Feature built-in to the language
  
 ===== Cons ===== ===== Cons =====
- * More "bloat" in the global namespace +  * More "bloat" in the global namespace 
- * Follows an old naming scheme +  * Follows an old naming scheme 
- * Adds a function alias to the language +  * Adds a function alias to the language 
- Easely implemented in userland+  Easily implemented in userland
  
 ===== Backward Incompatible Changes ===== ===== Backward Incompatible Changes =====
Line 31: Line 35:
 ===== Open Issues ===== ===== Open Issues =====
 How to handle the newly created alias. 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 ===== ===== Proposed Voting Choices =====
-2/3 Majority for adding strrstr (and possibly strristr after discussion).+2/3 Majority for adding <php>strrstr</php> (and possibly <php>strristr</php> after discussion).
  
 ===== Patches and Tests ===== ===== Patches and Tests =====
-Links to any external patches and tests go here. +GitHub PR [[https://github.com/php/php-src/pull/4064|#4064]]
- +
-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 ===== ===== Implementation =====
Line 57: Line 50:
  
 ===== References ===== ===== References =====
-Links to external references, discussions or RFCs+Announcement on internals: [[https://externals.io/message/105997]]
  
-===== 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