php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #46806 mb_strimwidth
Submitted: 2008-12-09 03:35 UTC Modified: 2009-11-20 11:50 UTC
From: swiab0729 at gmail dot com Assigned: moriyoshi (profile)
Status: Closed Package: Documentation problem
PHP Version: 5.2CVS-2008-12-09 (CVS) OS: FreeBSD
Private report: No CVE-ID: None
 [2008-12-09 03:35 UTC] swiab0729 at gmail dot com
Description:
------------
When the original sring $str is longer then $width of the desired trim, the width of the truncated string returned by mb_strimwidth() will count "length of $trimmarker" in.

Reproduce code:
---------------
echo mb_strimwidth('helloworld', 0, 5, '...', 'UTF-8');
echo mb_strimwidth('hello', 0, 5, '...', 'UTF-8');

Expected result:
----------------
hello...
hello

Actual result:
--------------
he...
hello

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-01-04 16:37 UTC] moriyoshi@php.net
The behavior is correct, but the document is wrong.

See http://news.php.net/php.internals/42473


 [2009-11-20 11:50 UTC] vrana@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 [2009-11-20 11:51 UTC] svn@php.net
Automatic comment from SVN on behalf of vrana
Revision: http://svn.php.net/viewvc/?view=revision&revision=291069
Log: Improve example (bug #46806)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 10 08:01:33 2024 UTC