Bug #76512 [Ana]: \w no longer includes unicode characters
| From: | ab@php.net | Date: | Thu, 21 Jun 2018 17:25:51 +0000 |
| Subject: | Bug #76512 [Ana]: \w no longer includes unicode characters | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-215840@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76512&edit=1
ID: 76512
Updated by: ab@php.net
Reported by: leo dot feyer at gmail dot com
Summary: \w no longer includes unicode characters
Status: Analyzed
Type: Bug
Package: PCRE related
Operating System: MacOS
PHP Version: 7.3.0alpha2
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
That's the correct diagnose, Christoph. It was not intended and is a trivial porting mistake.
It affected also ext/pcre/tests/bug52971.phpt which looked like a beaviour change.
Seems there might be also an additional issue with the locale handling on Windows. I'm not sure
yet it's about PCRE2 or setlocale(), needs more investigation.
Thanks.
Previous Comments:
------------------------------------------------------------------------
[2018-06-21 15:51:13] cmb@php.net
> It seems to me that this PCRE_UCP[1] should actually be PCRE2_UCP.
Indeed.
------------------------------------------------------------------------
[2018-06-21 14:19:32] cmb@php.net
It seems to me that this PCRE_UCP[1] should actually be PCRE2_UCP.
[1] <https://github.com/php/php-src/blob/5eb1f92f31cafc48384f9096012f421b37f6d425/ext/pcre/php_pcre.c#L676>
------------------------------------------------------------------------
[2018-06-21 13:47:21] leo dot feyer at gmail dot com
Description:
------------
The \w escape sequence no longer includes unicode characters in PHP 7.3.
See https://3v4l.org/uJKEC
I don't know if this is intended, but since the change is not mentioned in the UPGRADING file,
it might be not.
Test script:
---------------
var_dump(preg_match('/\w/u', 'ä'));
Expected result:
----------------
The test script returns int(1) on PHP <7.3 and int(0) on PHP 7.3.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76512&edit=1