php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48790 Unicode character properties misbehave
Submitted: 2009-07-03 16:59 UTC Modified: 2009-07-03 20:27 UTC
From: php at pwnt dot be Assigned:
Status: Not a bug Package: PCRE related
PHP Version: 5.2.10 OS: All
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: php at pwnt dot be
New email:
PHP Version: OS:

 

 [2009-07-03 16:59 UTC] php at pwnt dot be
Description:
------------
The behavior described at http://php.net/manual/en/regexp.reference.unicode.php seems to have changed between PHP 5.2.8 and 5.2.10 (don't know about 5.2.9). I use preg_match() with a \p regexp to check if a character is a letter (or a number, in this case), and this seems to fail for wide characters in 5.2.10.

Reproduce code:
---------------
echo preg_match('/^[\pL\pN]$/', '?');

Expected result:
----------------
1

Actual result:
--------------
PHP 5.2.8: 1
PHP 5.2.10: 0

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-07-03 17:09 UTC] php at pwnt dot be
This also occurs on Linux.
 [2009-07-03 20:27 UTC] nlopess@php.net
The reproduce code is broken (I cannot read the input character), but anyway if this is a bug, it's surelly not in PHP.
If you strongly believe this is a bug, please report it to the PCRE team.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed May 18 10:05:45 2022 UTC