Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comparing match results (preg_match) #974

Closed
TomatorCZ opened this issue Aug 10, 2021 · 0 comments
Closed

Comparing match results (preg_match) #974

TomatorCZ opened this issue Aug 10, 2021 · 0 comments
Assignees
Labels

Comments

@TomatorCZ
Copy link
Member

TomatorCZ commented Aug 10, 2021

Peachpie returns wrong offsets in matches.

Implication:
WordPress plugin GutenSlider doesn't work properly (issue #99).

Example:

<?php
preg_match('/(?P<fooname>foo)?(bar)/', 'bar', $matches, PREG_OFFSET_CAPTURE);
$is_fooname = isset( $matches['fooname'] ) && -1 !== $matches['fooname'][1];
var_dump($is_fooname);

Expected value:
bool(false)
Actual value:
bool(true)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants