Bug #80961 [NEW]: PCRE treats ellipsis character as a letter

From: Date: Fri, 16 Apr 2021 09:14:18 +0000
Subject: Bug #80961 [NEW]: PCRE treats ellipsis character as a letter
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-233463@lists.php.net to get a copy of this message
From:             f dot sowade at r9e dot de
Operating system: Linux and Mac OS X
PHP version:      8.0.3
Package:          PCRE related
Bug Type:         Bug
Bug description:PCRE treats ellipsis character as a letter

Description:
------------
The intl extension reports the Unicode ellipsis character (U+2026) to be
a punctuation. PCRE matches the ellipsis when matching letters but not
when matching punctuation. So the character class for the ellipsis
differs between the intl extension and PCRE. I think that intl is
correct here and the character class should be punctuation. But both
extensions should at least agree on the same character class.

Test script:
---------------
var_dump(IntlChar::ispunct("\u{2026}")); // true
var_dump(IntlChar::isalpha("\u{2026}")); // false

var_dump(preg_match('/\\p{Z}/', "\u{2026}")); // 0 (but would expect 1)
var_dump(preg_match('/\\p{L}/', "\u{2026}")); // 1 (but would expect 0)

Expected result:
----------------
bool(true)
bool(false)
int(1)
int(0)

Actual result:
--------------
bool(true)
bool(false)
int(0)
int(1)

-- 
Edit bug report at https://bugs.php.net/bug.php?id=80961&edit=1
-- 
Fix committed:                    https://bugs.php.net/fix.php?id=80961&r=fixed
Fixed in release:                 https://bugs.php.net/fix.php?id=80961&r=alreadyfixed
Need backtrace:                   https://bugs.php.net/fix.php?id=80961&r=needtrace
Need Reproduce Script:            https://bugs.php.net/fix.php?id=80961&r=needscript
Try newer version:                https://bugs.php.net/fix.php?id=80961&r=oldversion
Not developer issue:              https://bugs.php.net/fix.php?id=80961&r=support
Expected behavior:                https://bugs.php.net/fix.php?id=80961&r=notwrong
Not enough info:                  https://bugs.php.net/fix.php?id=80961&r=notenoughinfo
Submitted twice:                  https://bugs.php.net/fix.php?id=80961&r=submittedtwice
register_globals:                 https://bugs.php.net/fix.php?id=80961&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80961&r=phptooold
Daylight Savings:                 https://bugs.php.net/fix.php?id=80961&r=dst
IIS Stability:                    https://bugs.php.net/fix.php?id=80961&r=isapi
Install GNU Sed:                  https://bugs.php.net/fix.php?id=80961&r=gnused
Floating point limitations:       https://bugs.php.net/fix.php?id=80961&r=float
No Zend Extensions:               https://bugs.php.net/fix.php?id=80961&r=nozend
MySQL Configuration Error:        https://bugs.php.net/fix.php?id=80961&r=mysqlcfg


Thread (3 messages)

« previous php.bugs (#233463) next »