Bug #74612 [Opn]: A backreference to a branch reset group
| From: | oleynikovny at mail dot ru | Date: | Thu, 18 May 2017 15:02:12 +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-209186@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
User updated by: oleynikovny at mail dot ru
Reported by: oleynikovny at mail dot ru
-Summary: A back reference to a branch reset group
+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:
Adjusted a summary.
Previous Comments:
------------------------------------------------------------------------
[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