|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2020-03-10 13:37 UTC] 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
PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 10:00:01 2025 UTC |
Hello again. I have tested the following in 2 builds of PHP-7.4.14, one from Ubuntu 18.04 repository and another one build with phpbrew. Unfortunately the results are different. I think phpbrew is correct. Test script: ------------ echo(preg_replace('/[^\p{L}\p{Arabic}]/', '0', '<->')); Expected result (phpbrew): ------------ 000 Actual result (ubuntu): ----------------------- <-> Should this be opened again or it needs to be reported elsewhere?