php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #67041 POSIX character classes and UTF-8
Submitted: 2014-04-07 21:48 UTC Modified: 2016-06-22 16:03 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: cmbecker69 at gmx dot de Assigned: cmb (profile)
Status: Duplicate Package: PCRE related
PHP Version: 5.5.11 OS: *
Private report: No CVE-ID: None
 [2014-04-07 21:48 UTC] cmbecker69 at gmx dot de
Description:
------------
The PREG manual states[1]:

| In UTF-8 mode, characters with values greater than 128 do not
| match any of the POSIX character classes.

However, that is not necessarily true, so the statement should be
changed appropriately.

Test script:
---------------
var_dump(preg_match('/^[[:alnum:]]$/u', "\xc3\x84"));

Expected result:
----------------
int(0) // expected according to the current documentation

Actual result:
--------------
int(1)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-04-08 14:37 UTC] trainmaster at gmx dot net
Introduced with 5.3.4? http://3v4l.org/RNhTU
 [2014-04-15 22:51 UTC] dm@php.net
-Status: Open +Status: Analyzed
 [2014-04-15 22:51 UTC] dm@php.net
It seems that behavior changed in 5.3.4 (PCRE updated to 8.10). However, I couldn't see relevant changes that cause this. Will look further, if anything, docs can be updated to reflect it.

Thanks for report.
 [2014-11-10 21:56 UTC] cmbecker69 at gmx dot de
> The PREG manual states[1]:

I had forgotten the footnote. It should have been

[1] <http://php.net/manual/en/regexp.reference.character-classes.php>

> However, I couldn't see relevant changes that cause this.

It seems to me that the change might be caused by item 9 in the
changelog of Version 8.10 25-Jun-2010[2].

[2] <http://www.pcre.org/changelog.txt>
 [2016-06-22 16:03 UTC] cmb@php.net
-Status: Analyzed +Status: Duplicate -Assigned To: +Assigned To: cmb
 [2016-06-22 16:03 UTC] cmb@php.net
This issue had been reported again as bug #72353, and already
fixed, so I'm marking this ticket as duplicate.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 09:01:28 2024 UTC