Doc #73669 [Ver]: iconv_substr not work correctly
| From: | axot at axot dot org | Date: | Wed, 07 Dec 2016 14:42:33 +0000 |
| Subject: | Doc #73669 [Ver]: iconv_substr not work correctly | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-14181@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
User updated by: axot at axot dot org
Reported by: axot at axot dot org
Summary: iconv_substr not work correctly
Status: Verified
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, I test this code both in 7.0.13 and 7.1.0. All of the 2
version failed.
Previous Comments:
------------------------------------------------------------------------
[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