rfc:str_contains

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
rfc:str_contains [2020/02/17 12:01]
philippta
rfc:str_contains [2020/08/01 23:41] (current)
carusogabriel RFC was implemented
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: Implemented
   * 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="true">
 +   * 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.1581940904.txt.gz · Last modified: 2020/02/17 12:01 by philippta