php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #77316 (?X) produces warning: Compilation failed: unrecognized character after (? or (
Submitted: 2018-12-18 18:35 UTC Modified: 2018-12-18 19:22 UTC
From: sp at fp dot de Assigned: cmb (profile)
Status: Closed Package: PCRE related
PHP Version: 7.3.0 OS:
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: sp at fp dot de
New email:
PHP Version: OS:

 

 [2018-12-18 18:35 UTC] sp at fp dot de
Description:
------------
Using the PCRE_EXTRA modifier as an internal option setting inside the pattern string now produces a warning:
"Warning: preg_match(): Compilation failed: unrecognized character after (? or (?- at offset 2"

I'm not really sure if this is intentional, as the RFC states:
"The current patch reverts the behavior to the meaning of 'X' how it was in PCRE"
https://wiki.php.net/rfc/pcre2-migration

If it indeed is intentional, then at least the documentation should be updated accordingly:
http://php.net/manual/en/regexp.reference.internal-options.php

Test script:
---------------
preg_match('/(?X)/', '');


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-12-18 19:10 UTC] cmb@php.net
-Status: Open +Status: Verified -Assigned To: +Assigned To: cmb
 [2018-12-18 19:10 UTC] cmb@php.net
> "The current patch reverts the behavior to the meaning of 'X'
> how it was in PCRE"

This is about the X *modifier*, not about the internal option.
So yes, this is a documentation issue.
 [2018-12-18 19:22 UTC] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=346384
Log: Fix #77316: (?X) produces warning: Compilation failed: unrecognized character after (? or (
 [2018-12-18 19:22 UTC] cmb@php.net
-Status: Verified +Status: Closed
 [2018-12-18 19:22 UTC] cmb@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.
 [2020-02-07 06:05 UTC] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=d65981e8ecf8def27d75b1899dfd1dfff7d29277
Log: Fix #77316: (?X) produces warning: Compilation failed: unrecognized character after (? or (
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 15:01:29 2024 UTC