PHP Bugs  
php.net | support | documentation | report a bug | advanced search | search howto | statistics | login

go to bug id or search bugs for  

Bug #46806 mb_strimwidth
Submitted:9 Dec 2008 3:35am UTC Modified: 20 Nov 11:50am UTC
From:swiab0729 at gmail dot com Assigned to:moriyoshi
Status:Closed Category:Documentation problem
Version:5.2CVS-2008-12-09 (CVS) OS:FreeBSD
View/Vote Developer Edit Submission

[9 Dec 2008 3:35am 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
[4 Jan 4:37pm UTC] moriyoshi@php.net
The behavior is correct, but the document is wrong.

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

[20 Nov 11:50am 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.

[20 Nov 11:51am 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)

RSS feed | show source 

PHP Copyright © 2001-2009 The PHP Group
All rights reserved.
Last updated: Sat Nov 21 10:30:49 2009 UTC