rfc:str_contains

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
rfc:str_contains [2020/02/17 12:01] philipptarfc:str_contains [2020/03/02 08:35] philippta
Line 3: Line 3:
   * Date: 2020-02-17   * Date: 2020-02-17
   * Author: Philipp Tanlak, philipp.tanlak@gmail.com   * Author: Philipp Tanlak, philipp.tanlak@gmail.com
-  * Status: Under Discussion+  * Status: Voting
   * First Published at: http://wiki.php.net/rfc/str_contains   * First Published at: http://wiki.php.net/rfc/str_contains
  
Line 40: Line 40:
 str_contains("", "");     // true str_contains("", "");     // true
 </code> </code>
 +
 +Regarding empty string values as $needle:
 +<blockquote>As of PHP 8, behavior of "" in string search functions is well defined, and we consider "" to occur at every position in the string, including one past the end. As such, both of these will (or at least should) return true. The empty string is contained in every string. - Nikita Popov</blockquote>
  
  
Line 57: Line 60:
 PHP 8 PHP 8
  
 +===== Voting =====
 +<doodle title="Add str_contains as described" auth="philippta" voteType="single" closed="false">
 +   * Yes
 +   * No
 +</doodle>
  
 ===== Implementation ===== ===== Implementation =====
 The ''str_contains'' function has been implemented in this pull request: The ''str_contains'' function has been implemented in this pull request:
 https://github.com/php/php-src/pull/5179 https://github.com/php/php-src/pull/5179
rfc/str_contains.txt · Last modified: 2020/08/01 23:41 by carusogabriel