php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73075 php compatibility: substr_count()
Submitted: 2016-09-14 01:00 UTC Modified: 2016-09-14 01:31 UTC
From: lars at moelleken dot org Assigned: cmb (profile)
Status: Duplicate Package: Strings related
PHP Version: 7.1.0RC1 OS: Ubuntu 12.04.5 LTS
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or 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:00 UTC] lars at moelleken dot org
Description:
------------
substr_count() (PHP 7.1RC1) is not compatible with previews PHP versions

https://3v4l.org/SfHKl

Test script:
---------------
var_dump(substr_count('abcde', 'de', -2, 2));


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

Actual result:
--------------
int(1)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-09-14 01:31 UTC] cmb@php.net
-Status: Open +Status: Duplicate -Assigned To: +Assigned To: cmb
 [2016-09-14 01:31 UTC] cmb@php.net
Basically, this is a duplicate of bug #73076 – not only
mb_strpos(), but also substr_count() and several other functions
have been enhanced to also accept negative string offsets, see
<https://github.com/php/php-src/blob/php-7.1.0RC1/UPGRADING>.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 13:01:30 2024 UTC