Skip to content

pcre: minor refactoring and improvements - #23928

Draft
Girgias wants to merge 7 commits into
php:masterfrom
Girgias:pcre-errors
Draft

Girgias wants to merge 7 commits into
php:masterfrom
Girgias:pcre-errors

Conversation

@Girgias

@Girgias Girgias commented Sep 26, 2026

Copy link
Copy Markdown
Member

Commits should be reviewed in order.

@Girgias

Girgias commented Sep 26, 2026

Copy link
Copy Markdown
Member Author

@aldemeery you may want to have a look at this.

Comment on lines +6 to +13
$subject = 'hello';
$pattern = '/a(?C1)b(?C2)c/';

var_dump(preg_match($pattern, $subject));

?>
--EXPECT--
int(0)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'hello' has no 'a' in it...and so, matching will never reach either callout point at all...which means int(0) does not really show that callouts are not supported, I guess it only shows the pattern compiles...or am I missing something here?

Comment thread ext/pcre/php_pcre.c
} else {
pcre2_get_error_message(errnumber, error, sizeof(error));
switch (errnumber) {
case PCRE2_ERROR_BACKSLASH_K_IN_LOOKAROUND:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: you either need to guard it or update config0.m4 min. version check (was added for 10.38).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I might try and upgrade the minimal version to 10.40.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants