php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #55452 Confusing description for mb_strcut()
Submitted: 2011-08-18 16:18 UTC Modified: 2011-08-25 20:22 UTC
From: daniel dot rhodes at warpasylum dot co dot uk Assigned: nikic (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: daniel dot rhodes at warpasylum dot co dot uk
New email:
PHP Version: OS:

 

 [2011-08-18 16:18 UTC] daniel dot rhodes at warpasylum dot co dot uk
Description:
------------
---
From manual page: http://www.php.net/function.mb-strcut%23Description
---

"mb_strcut() performs equivalent operation as mb_substr() with different method. 
If start position is multi-byte character's second byte or larger, it starts 
from first byte of multi-byte character." kind of implies that mb_substr() 
*also* counts using bytes and is somehow broken. Both of which aren't true.

Could we perhaps in the "Parameters" box for mb_strcut() state that $start and 
$length are counted in BYTES ?

Could we perhaps in the "Parameters" box for mb_substr() state that $start and 
$length are counted in CHARACTERS ?

I see much confusion in this area in the User Contributed Notes too...


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-08-25 20:20 UTC] nikic@php.net
Automatic comment from SVN on behalf of nikic
Revision: http://svn.php.net/viewvc/?view=revision&revision=315516
Log: Fix Doc Bug #55452: Confusing description for mb_strcut()
 [2011-08-25 20:22 UTC] nikic@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: nikic
 [2011-08-25 20:22 UTC] nikic@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.

I changed the description of mb_strcut and the paramters of both mb_substr and mb_strcut to make the difference more clear.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 21:00:02 2026 UTC