php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76526 Different behaviour shorthand escape codes vs unicode
Submitted: 2018-06-25 09:59 UTC Modified: 2018-06-25 10:01 UTC
From: bugs dot php dot net_nospam at adviesenzo dot nl Assigned:
Status: Duplicate Package: PCRE related
PHP Version: 7.3.0alpha2 OS:
Private report: No CVE-ID: None
 [2018-06-25 09:59 UTC] bugs dot php dot net_nospam at adviesenzo dot nl
Description:
------------
Not sure whether this is a bug or a feature, so reporting this for someone else to make that determination.

PCRE used to find a match using the below example code on PHP < 7.3, but no longer matches on PHP 7.3.

See: https://3v4l.org/lunKA

Is suspect the behavioural change is related to the implementation of PCRE 2 in PHP 7.3 - https://wiki.php.net/rfc/pcre2-migration .

Test script:
---------------
setlocale(LC_ALL, 'C');
var_dump(preg_match('`^\w+$`u', 'Iñtërnâtiônàlizætiøn'));

Expected result:
----------------
I'd expected the results of the regex to be the same cross-version.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-06-25 10:01 UTC] nikic@php.net
-Status: Open +Status: Duplicate
 [2018-06-25 10:01 UTC] nikic@php.net
Duplicate of bug #76512. This will be fixed in the next alpha :)
 [2018-06-25 10:08 UTC] bugs dot php dot net_nospam at adviesenzo dot nl
Hi Nikita, thanks!
I'd searched, but only looked at the open issues, so I missed that it had been reported and fixed already ;-)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 03 17:01:29 2024 UTC