|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #73669 iconv_substr not work correctly
Submitted: 2016-12-06 16:52 UTC Modified: 2016-12-08 01:41 UTC
From: axot at axot dot org Assigned: cmb (profile)
Status: Closed Package: ICONV related
PHP Version: 7.0.13 OS: Mac
Private report: No CVE-ID: None
 [2016-12-06 16:52 UTC] axot at axot dot org
If str is shorter than offset characters long, FALSE will be returned.
But string(0) returned.

Test script:
var_dump(iconv_substr('20', 2, 1));

Expected result:

Actual result:
string(0) ""


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-12-07 14:27 UTC]
-Status: Open +Status: Verified -Type: Bug +Type: Documentation Problem -Package: *General Issues +Package: ICONV related -Assigned To: +Assigned To: cmb
 [2016-12-07 14:27 UTC]
To match the behavior of substr() and mb_substr() in PHP 7, iconv_substr() has been fixed as of PHP 7.0.11 (see bug #72320 and <>). This has not been documented, however.
 [2016-12-07 14:42 UTC] axot at axot dot org
I think this is a different case to #72320, I test this code both in 7.0.13 and 7.1.0. All of the 2 version failed.
 [2016-12-07 14:48 UTC]
Automatic comment from SVN on behalf of cmb
Log: Fix #73669: iconv_substr not work correctly
 [2016-12-07 14:50 UTC]
-Status: Verified +Status: Closed
 [2016-12-07 14:50 UTC]
> I think this is a different case to #72320, […]

This is not a different case as #72320, but rather due to fixing #72320, the behavior has changed in PHP 7.0.11.
 [2016-12-07 14:58 UTC] axot at axot dot org
Thank you for the information, should I think this is not a bug now, it just not been document. So I can trust the new behavior ?
 [2016-12-07 15:08 UTC]
I have already committed the respective changes to the documentation: <;revision=341328>. It will take a while until this commit is rolled out to the PHP manual on all mirrors, though.
 [2016-12-08 01:41 UTC] axot at axot dot org
Thank you for updating the documentation.
 [2020-02-07 06:06 UTC]
Automatic comment on behalf of cmb
Log: Fix #73669: iconv_substr not work correctly
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jul 15 03:01:28 2024 UTC