Bug #81584 [Opn]: mb_strwidth() returns incorrect value

From: Date: Mon, 01 Nov 2021 17:44:12 +0000
Subject: Bug #81584 [Opn]: mb_strwidth() returns incorrect value
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-237488@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=81584&edit=1

 ID:                 81584
 Updated by:         nikic@php.net
 Reported by:        azjezz at protonmail dot com
 Summary:            mb_strwidth() returns incorrect value
 Status:             Open
 Type:               Bug
 Package:            mbstring related
 Operating System:   N/A
 PHP Version:        8.1.0RC5
-Assigned To:        
+Assigned To:        alexdowad
 Block user comment: N
 Private report:     N

 New Comment:

Possibly due to https://github.com/php/php-src/commit/d8c785b894e1a4ed9793d71cad02330cb0034faa?


Previous Comments:
------------------------------------------------------------------------
[2021-11-01 17:19:24] azjezz at protonmail dot com

test script: https://3v4l.org/X6DWb

------------------------------------------------------------------------
[2021-11-01 17:17:33] azjezz at protonmail dot com

Description:
------------
The "width" or a string containing emojis has changed between PHP <= 8.0 and 8.1.


Test script:
---------------
var_dump(
  mb_strwidth('☕ ☕ ☕'),
  mb_strwidth('????????????'),
  mb_strwidth('♈♉♊♋♌♍♎♏♐♑♒♓'),
);

Expected result:
----------------
int(5)
int(3)
int(12)

Actual result:
--------------
int(8)
int(6)
int(24)


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=81584&edit=1


Thread (6 messages)

« previous php.bugs (#237488) next »