|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79846 8c67c166996 broke simple regexp
Submitted: 2020-07-13 11:27 UTC Modified: 2020-07-15 16:44 UTC
From: Assigned: cmb (profile)
Status: Closed Package: PCRE related
PHP Version: 8.0.0alpha2 OS: archLinux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2020-07-13 11:27 UTC]
I have bisected commit 8c67c166996ae1d6809f0beaf691836e37d6afc1 to fail unexpectedly on a pretty simple regexp, see

pcre2test works fine implying a bug in PHP

Test script:
$item = "component_phase_1";

preg_match("/([a-z]+_[a-z]+_*[a-z]+)_?(\d+)?/", $item, $match);


Expected result:
array(3) {
  string(17) "component_phase_1"
  string(15) "component_phase"
  string(1) "1"

Actual result:
array(0) {


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-07-13 12:40 UTC]
Probably the same issue also caused
 [2020-07-13 12:56 UTC]
-Status: Open +Status: Assigned -Assigned To: +Assigned To: cmb
 [2020-07-13 12:56 UTC]
Works with -d pcre.jit=0, so presumably a PCRE JIT bug.

I guess that answers our question on whether it's safe to update PCRE on PHP 7.4...
 [2020-07-14 09:35 UTC]
-Status: Assigned +Status: Verified
 [2020-07-14 09:35 UTC]
Yes, that appears to be an upstream issue.  I've filed <>.
 [2020-07-14 09:39 UTC] bugreports2 at gmail dot com
> I guess that answers our question on whether it's safe to update PCRE on PHP 7.4

as long as other things like are broken you can't win that game unless upstream applies a better QA - guess why Fedora has that much pcre2 patches all the time and they never hit php-rsc
 [2020-07-14 10:34 UTC]
-Status: Verified +Status: Suspended
 [2020-07-15 16:44 UTC]
-Status: Suspended +Status: Open
 [2020-07-15 16:44 UTC]
The upstream bug has been fixed already!
 [2020-07-15 16:47 UTC]
The following pull request has been associated:

Patch Name: Fix #79846: 8c67c166996 broke simple regexp
On GitHub:
 [2020-07-16 16:33 UTC]
Automatic comment on behalf of
Log: Fix #79846: 8c67c166996 broke simple regexp
 [2020-07-16 16:33 UTC]
-Status: Assigned +Status: Closed
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Oct 20 21:03:34 2021 UTC