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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: lars at moelleken dot org
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 03:01:28 2024 UTC