Bug #79363 [NEW]: \p{L} doesn't work alongside \p{Arabic} in a character class
| From: | halaeiv at gmail dot com | Date: | Tue, 10 Mar 2020 13:37:17 +0000 |
| Subject: | Bug #79363 [NEW]: \p{L} doesn't work alongside \p{Arabic} in a character class | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-226005@lists.php.net to get a copy of this message | ||
From: halaeiv at gmail dot com
Operating system: Ubuntu
PHP version: 7.4.3
Package: PCRE related
Bug Type: Bug
Bug description:\p{L} doesn't work alongside \p{Arabic} in a character class
Description:
------------
I ran the following code in both PHP 7.2.28 and PHP 7.4.3. The output of
PHP 7.4.3 is wrong. Basically, adding a \p{Arabic} after \p{L} seems to
causes \p{L} to match uppercases and spaces, instead of letters.
Test script:
---------------
$str = 'lower UPPER';
echo(preg_replace('/[\p{L}\p{Arabic}]/', '0', $str));
echo "\n";
echo(preg_replace('/[^\p{L}\p{Arabic}]/', '0', $str));
echo "\n";
Expected result:
----------------
00000 00000
lower0UPPER
Actual result:
--------------
lower000000
00000 UPPER
--
Edit bug report at https://bugs.php.net/bug.php?id=79363&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79363&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79363&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79363&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79363&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79363&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79363&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79363&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79363&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79363&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79363&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79363&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79363&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79363&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79363&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79363&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79363&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79363&r=mysqlcfg