Bug #74612 [Opn]: A backreference to a branch reset group
| From: | nikic@php.net | Date: | Mon, 18 Mar 2019 16:59:44 +0000 |
| Subject: | Bug #74612 [Opn]: A backreference to a branch reset group | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-220063@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74612&edit=1
ID: 74612
Updated by: nikic@php.net
Reported by: oleynikovny at mail dot ru
Summary: A backreference to a branch reset group
Status: Open
Type: Bug
Package: PCRE related
Operating System: GNU/Linux
PHP Version: 7.1.5
Block user comment: N
Private report: N
New Comment:
Looks like this got fixed in PHP 7.3 due to the update to PCRE2.
It looks like there also was a new PCRE1 release recently, but I'm not seeing this issue in the
changelog.
Previous Comments:
------------------------------------------------------------------------
[2017-05-18 16:05:20] requinix@php.net
https://3v4l.org/J6L3u
Works without JIT. https://3v4l.org/7dAic
Upstream bug?
------------------------------------------------------------------------
[2017-05-18 15:02:11] oleynikovny at mail dot ru
Adjusted a summary.
------------------------------------------------------------------------
[2017-05-18 14:59:54] oleynikovny at mail dot ru
Adjusted a summary.
------------------------------------------------------------------------
[2017-05-18 14:58:06] oleynikovny at mail dot ru
Description:
------------
A backreference to a branch reset group works as expected in PHP 5 but not in PHP 7.
Test script:
---------------
<?php
$string = '--';
$doesNotMatchInPhp7 = '/(?|(---)|(-))\1$/';
$matchesInPhp7 = '/(?|(-)|(---))\1$/';
var_dump(preg_match($doesNotMatchInPhp7, $string));
var_dump(preg_match($matchesInPhp7, $string));
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74612&edit=1