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
 [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: Sun May 22 21:05:44 2022 UTC