Doc #73669 [Ver->Csd]: iconv_substr not work correctly
| From: | cmb@php.net | Date: | Wed, 07 Dec 2016 14:50:19 +0000 |
| Subject: | Doc #73669 [Ver->Csd]: iconv_substr not work correctly | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-14182@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=73669&edit=1
ID: 73669
Updated by: cmb@php.net
Reported by: axot at axot dot org
Summary: iconv_substr not work correctly
-Status: Verified
+Status: Closed
Type: Documentation Problem
Package: ICONV related
Operating System: Mac
PHP Version: 7.0.13
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
> 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.
Previous Comments:
------------------------------------------------------------------------
[2016-12-07 14:48:06] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=341328
Log: Fix #73669: iconv_substr not work correctly
------------------------------------------------------------------------
[2016-12-07 14:42:31] 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:27:34] cmb@php.net
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 <https://3v4l.org/qhP6H>).
This has not been documented, however.
------------------------------------------------------------------------
[2016-12-06 16:52:16] axot at axot dot org
Description:
------------
If str is shorter than offset characters long, FALSE will be returned.
But string(0) returned.
Test script:
---------------
<?php
var_dump(iconv_substr('20', 2, 1));
?>
Expected result:
----------------
bool(false)
Actual result:
--------------
string(0) ""
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=73669&edit=1