|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76512 \w no longer includes unicode characters
Submitted: 2018-06-21 13:47 UTC Modified: 2018-06-21 20:48 UTC
Avg. Score:4.0 ± 1.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: leo dot feyer at gmail dot com Assigned: cmb (profile)
Status: Closed Package: PCRE related
PHP Version: 7.3.0alpha2 OS: MacOS
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
30 + 27 = ?
Subscribe to this entry?

 [2018-06-21 13:47 UTC] leo dot feyer at gmail dot com
The \w escape sequence no longer includes unicode characters in PHP 7.3.


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.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-06-21 14:19 UTC]
It seems to me that this PCRE_UCP[1] should actually be PCRE2_UCP.

[1] <>
 [2018-06-21 15:51 UTC]
-Status: Open +Status: Analyzed -Assigned To: +Assigned To: cmb
 [2018-06-21 15:51 UTC]
> It seems to me that this PCRE_UCP[1] should actually be PCRE2_UCP.

 [2018-06-21 17:25 UTC]
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.

 [2018-06-21 20:47 UTC]
Automatic comment on behalf of
Log: Fix #76512: \w no longer includes unicode characters
 [2018-06-21 20:47 UTC]
-Status: Analyzed +Status: Closed
 [2018-06-21 20:48 UTC]
Thanks, Anatol. I'll try to have a look at the locale stuff on
Windows later.

And of course, thanks, Leo, for reporting this issue!
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Oct 26 22:01:23 2020 UTC