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
 [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.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Mon Sep 16 00:01:27 2019 UTC