Bug #79363 [ReO->Sus]: \p{L} doesn't work alongside \p{Arabic} in a character class

From: Date: Tue, 30 Jun 2020 14:22:31 +0000
Subject: Bug #79363 [ReO->Sus]: \p{L} doesn't work alongside \p{Arabic} in a character class
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-227745@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=79363&edit=1 ID: 79363 Updated by: cmb@php.net Reported by: halaeiv at gmail dot com Summary: \p{L} doesn't work alongside \p{Arabic} in a character class -Status: Re-Opened +Status: Suspended Type: Bug Package: PCRE related Operating System: Ubuntu PHP Version: 7.4.3 -Assigned To: cmb +Assigned To: Block user comment: N Private report: N New Comment: The master branch has just been updated to PCRE2 10.35, so that will be available as of PHP 8.0.0alpha2. Updating for PHP 7.4 will be considered at the earliest in several weeks; for the time being I'm suspending this ticket. Previous Comments: ------------------------------------------------------------------------ [2020-06-30 12:49:42] cmb@php.net The following pull request has been associated: Patch Name: Update to PCRE2 10.35 On GitHub: https://github.com/php/php-src/pull/5783 Patch: https://github.com/php/php-src/pull/5783.patch ------------------------------------------------------------------------ [2020-06-30 11:06:16] halaeiv at gmail dot com PCRE 10.35 is released with the bug being fixed. But it is not still used in PHP 7.4 branch. So I believe this issue is now a PHP bug and should be reopened. Any plan to fix? ------------------------------------------------------------------------ [2020-03-11 08:49:30] cmb@php.net Indeed, this is not a bug in PHP, but rather in libpcre. In libpcre 10.34, the behavior has been improved, but is still not quite right (with JIT enabled): 00000000000 lower UPPER ------------------------------------------------------------------------ [2020-03-11 08:04:39] halaeiv at gmail dot com There is a related bug report in pcre: https://bugs.exim.org/show_bug.cgi?id=2432 The bug's status is new, but it is mentioned that it was fixed in 10.34. I hope the next PHP version will fix it. There can be some additional tests to check. Note: the preg works with (*NO_JIT). ------------------------------------------------------------------------ [2020-03-10 13:37:17] halaeiv at gmail dot com 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 this bug report at https://bugs.php.net/bug.php?id=79363&edit=1

« previous php.bugs (#227745) next »