Doc #80738 [Com]: mb_stipos function

From: Date: Fri, 12 Feb 2021 14:42:35 +0000
Subject: Doc #80738 [Com]: mb_stipos function
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-18537@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80738&edit=1

 ID:                 80738
 Comment by:         rtrtrtrtrt at dfdfdfdf dot dfd
 Reported by:        mikele890 at gmail dot com
 Summary:            mb_stipos function
 Status:             Verified
 Type:               Documentation Problem
 Package:            mbstring related
 Operating System:   Linux
 PHP Version:        8.0.2
 Block user comment: N
 Private report:     N

 New Comment:

the old behavior was simply wrong

think logically: in most cases the second param is dynamic adn an empty string means "no
input" - how das it make sense to pretend that *nothing* is within everything?


Previous Comments:
------------------------------------------------------------------------
[2021-02-12 14:02:50] cmb@php.net

This is only documented in the migration guide[1] so far:

| The needle argument for mb_strpos(), mb_strrpos(), mb_stripos(),
| mb_strripos(), mb_strstr(), mb_stristr(), mb_strrchr() and
| mb_strrichr() can now be empty.

[1] <https://www.php.net/manual/en/migration80.incompatible.php>

------------------------------------------------------------------------
[2021-02-12 13:50:25] mikele890 at gmail dot com

Description:
------------
php < 8:
  var_dump(false === mb_stripos('123456789', ''));
Result:
  <br />
  <b>Warning</b>:  mb_stripos(): Empty delimiter in <b>[...][...]</b> on
line    <b>4</b><br />
  bool(true)

php 8:
  var_dump(false === mb_stripos('123456789', ''));
Result:
  bool(false)

In versions lesser than 8 it will throw a warning but return true, which is totally opposite to
version 8 result




------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=80738&edit=1


Thread (7 messages)

« previous php.doc.bugs (#18537) next »