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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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

Add a Patch

Pull Requests

Add a Pull Request

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: Fri Mar 29 00:01:28 2024 UTC