Doc #67041 [Ana->Dup]: POSIX character classes and UTF-8
Edit report at https://bugs.php.net/bug.php?id=67041&edit=1
ID: 67041
Updated by: cmb@php.net
Reported by: cmbecker69 at gmx dot de
Summary: POSIX character classes and UTF-8
-Status: Analyzed
+Status: Duplicate
Type: Documentation Problem
Package: PCRE related
Operating System: *
PHP Version: 5.5.11
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
This issue had been reported again as bug #72353, and already
fixed, so I'm marking this ticket as duplicate.
Previous Comments:
------------------------------------------------------------------------
[2014-11-10 21:56:54] 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>
------------------------------------------------------------------------
[2014-04-15 22:51:57] 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-04-08 14:37:32] trainmaster at gmx dot net
Introduced with 5.3.4? http://3v4l.org/RNhTU
------------------------------------------------------------------------
[2014-04-07 21:48:02] 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)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=67041&edit=1
Thread (5 messages)