|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2020-02-06 07:44 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 22:00:02 2025 UTC |
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ⅰʰ