|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34757 iconv_substr() gives "Unknown error" when offset > string length = 1
Submitted: 2005-10-06 14:11 UTC Modified: 2005-10-11 16:00 UTC
Avg. Score:3.0 ± 2.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: shagren at ua dot fm Assigned:
Status: Closed Package: ICONV related
PHP Version: 5CVS-2005-10-07 (cvs) OS: *
Private report: No CVE-ID:
 [2005-10-06 14:11 UTC] shagren at ua dot fm
For some "small"(or empty) stringes iconv_substr produce error when try to use offset > strlen

Reproduce code:
  $x = iconv_substr("a",3,2);

Expected result:

Actual result:
PHP Notice:  iconv_substr(): Unknown error (0) in C:\temp\1.php on line 2

Notice: iconv_substr(): Unknown error (0) in C:\temp\1.php on line 2



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-10-07 09:40 UTC]
I got the same result. ICONV is glibc 2.3.5 implementation.

 [2005-10-11 16:00 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Wed Nov 25 06:02:11 2015 UTC