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

From: Date: Mon, 01 Nov 2021 17:17:33 +0000
Subject: Bug #81584 [NEW]: mb_strwidth() returns incorrect value
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-237486@lists.php.net to get a copy of this message
From:             azjezz at protonmail dot com
Operating system: N/A
PHP version:      8.1.0RC5
Package:          mbstring related
Bug Type:         Bug
Bug description:mb_strwidth() returns incorrect value

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 bug report at https://bugs.php.net/bug.php?id=81584&edit=1
-- 
Fix committed:                    https://bugs.php.net/fix.php?id=81584&r=fixed
Fixed in release:                 https://bugs.php.net/fix.php?id=81584&r=alreadyfixed
Need backtrace:                   https://bugs.php.net/fix.php?id=81584&r=needtrace
Need Reproduce Script:            https://bugs.php.net/fix.php?id=81584&r=needscript
Try newer version:                https://bugs.php.net/fix.php?id=81584&r=oldversion
Not developer issue:              https://bugs.php.net/fix.php?id=81584&r=support
Expected behavior:                https://bugs.php.net/fix.php?id=81584&r=notwrong
Not enough info:                  https://bugs.php.net/fix.php?id=81584&r=notenoughinfo
Submitted twice:                  https://bugs.php.net/fix.php?id=81584&r=submittedtwice
register_globals:                 https://bugs.php.net/fix.php?id=81584&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=81584&r=phptooold
Daylight Savings:                 https://bugs.php.net/fix.php?id=81584&r=dst
IIS Stability:                    https://bugs.php.net/fix.php?id=81584&r=isapi
Install GNU Sed:                  https://bugs.php.net/fix.php?id=81584&r=gnused
Floating point limitations:       https://bugs.php.net/fix.php?id=81584&r=float
No Zend Extensions:               https://bugs.php.net/fix.php?id=81584&r=nozend
MySQL Configuration Error:        https://bugs.php.net/fix.php?id=81584&r=mysqlcfg


Thread (6 messages)

« previous php.bugs (#237486) next »