Bug #79233 [NEW]: Unicode character properties not working properly

From: Date: Thu, 06 Feb 2020 03:55:58 +0000
Subject: Bug #79233 [NEW]: Unicode character properties not working properly
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-225379@lists.php.net to get a copy of this message
From: yahiru1121 at gmail dot com Operating system: macOS Mojave 10.14.6 PHP version: 7.4.2 Package: *Regular Expressions Bug Type: Bug Bug description:Unicode character properties not working properly Description: ------------ Combining unicode property codes with supported scripts produces unexpected results Test script: --------------- <?php $str = 'aAaA亜あアア11ⅰʰ'; $regs = [ '/[\p{Nd}\p{Han}]/u', '/[\p{Nl}\p{Han}]/u', '/[\p{Lu}\p{Han}]/u', '/[\p{Ll}\p{Han}]/u', '/[\p{Lo}\p{Han}]/u', '/[\p{Lm}\p{Han}]/u', ]; foreach ($regs as $reg) { echo $reg, ' => ', preg_replace($reg, 'x️', $str), PHP_EOL; } Expected result: ---------------- /[\p{Nd}\p{Han}]/u => aAaAx️あアアx️x️ⅰʰ /[\p{Nl}\p{Han}]/u => aAaAx️あアア11x️ʰ /[\p{Lu}\p{Han}]/u => ax️ax️x️あアア11ⅰʰ /[\p{Ll}\p{Han}]/u => x️Ax️Ax️あアア11ⅰʰ /[\p{Lo}\p{Han}]/u => aAaAx️x️x️x️11ⅰʰ /[\p{Lm}\p{Han}]/u => aAaAx️あアア11ⅰx️ Actual result: -------------- /[\p{Nd}\p{Han}]/u => aAaAx️あアア11ⅰʰ /[\p{Nl}\p{Han}]/u => aAaAx️あアア11ⅰʰ /[\p{Lu}\p{Han}]/u => aAaAx️あアアx️x️ⅰʰ /[\p{Ll}\p{Han}]/u => ax️ax️x️あアア11ⅰʰ /[\p{Lo}\p{Han}]/u => aAaAx️あアア11ⅰʰ /[\p{Lm}\p{Han}]/u => aAaAx️あアア11ⅰʰ -- Edit bug report at https://bugs.php.net/bug.php?id=79233&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=79233&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=79233&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=79233&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=79233&r=needscript Try newer version: https://bugs.php.net/fix.php?id=79233&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=79233&r=support Expected behavior: https://bugs.php.net/fix.php?id=79233&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=79233&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=79233&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=79233&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=79233&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=79233&r=dst IIS Stability: https://bugs.php.net/fix.php?id=79233&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=79233&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=79233&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=79233&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=79233&r=mysqlcfg

« previous php.bugs (#225379) next »