php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #73076 php compatibility: mb_strpos()
Submitted: 2016-09-14 01:08 UTC Modified: 2016-09-14 11:55 UTC
From: lars at moelleken dot org Assigned: cmb (profile)
Status: Closed Package: mbstring related
PHP Version: 7.1.0RC1 OS: Ubuntu 12.04.5 LTS
Private report: No CVE-ID: None
 [2016-09-14 01:08 UTC] lars at moelleken dot org
Description:
------------
mb_strpos() is not compatible with old PHP versions.

https://3v4l.org/TsMA9

Test script:
---------------
var_dump(mb_strpos('ABC-ÖÄÜ-?-' . "\xc3\x28" . '中文空白-中文空白' . "\xf0\x28\x8c\x28" . 'abc', '白', -8));

Expected result:
----------------
bool(false)

Actual result:
--------------
int(20)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-09-14 01:25 UTC] cmb@php.net
-Type: Bug +Type: Documentation Problem -Package: Strings related +Package: mbstring related
 [2016-09-14 01:25 UTC] cmb@php.net
This behavioral change is caused by a deliberate improvement,
namely to generalize the support for negative string offsets,
see <https://wiki.php.net/rfc/negative-string-offsets>.

While this change is mentioned in UPGRADING[1] it is apparently
not yet documented in the manual. Therefore I'm changing to
doc-bug.

[1] <https://github.com/php/php-src/blob/php-7.1.0RC1/UPGRADING>
 [2016-09-14 01:25 UTC] cmb@php.net
-Status: Open +Status: Verified
 [2016-09-14 11:55 UTC] cmb@php.net
-Status: Verified +Status: Closed -Assigned To: +Assigned To: cmb
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Oct 24 07:03:34 2021 UTC