Bug #77388 [Opn]: invalid range in character class doesn't bubble up

From: Date: Mon, 31 Dec 2018 11:35:25 +0000
Subject: Bug #77388 [Opn]: invalid range in character class doesn't bubble up
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-218704@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77388&edit=1 ID: 77388 Updated by: nikic@php.net Reported by: sjon at hortensius dot net Summary: invalid range in character class doesn't bubble up Status: Open Type: Bug Package: PCRE related Operating System: archlinux PHP Version: 7.3.0 Block user comment: N Private report: N New Comment: Might be because we're setting PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL for BC reasons, though I don't think it's *supposed* to affect this case. Previous Comments: ------------------------------------------------------------------------ [2018-12-31 11:22:46] sjon at hortensius dot net Description: ------------ I found this while going through https://3v4l.org/bughunt/7.3.0/7.2.13+7.2.12 I'm not sure if this is a PHP or a PCRE bug (or maybe not a bug at all) but running the same regexp through pcre2test yields an error - but php accepts it since 7.3 $ pcre2test PCRE2 version 10.32 2018-09-10 re> /[^_-\s]/ Failed: error 150 at offset 6: invalid range in character class Test script: --------------- See https://3v4l.org/KICjT var_dump(preg_replace( '/[^_-\s]/' , '' , 'a b c d _ x' )); Expected result: ---------------- Warning: preg_replace(): Compilation failed: invalid range in character class at offset 5 in /in/KICjT on line 3 Actual result: -------------- string(5) "abcd_" ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=77388&edit=1

« previous php.bugs (#218704) next »