Re: BC break in master (7.2) - Distinguish between unmatched subpatterns and empty matches in preg_*()
| From: | Remi Collet | Date: | Mon, 15 May 2017 15:49:02 +0000 |
| Subject: | Re: BC break in master (7.2) - Distinguish between unmatched subpatterns and empty matches in preg_*() | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-99051@lists.php.net to get a copy of this message | ||
Le 15/05/2017 à 08:57, Nicolas Grekas a écrit :
> Hi,
>
> in master, feature request https://bugs.php.net/61780 has been
> implemented
> and merged into master thanks to
> https://github.com/php/php-src/pull/1303
I think everyone agree that BC should be avoid, when possible.
Even if this one is quite small, and have been tried to be as small as
possible, it exists.
Dev time are designed to detect such issues as soon as possible,
so first, thanks for reporting.
IMHO, I think a new flag to enable the new feature seems the nicest way
to keep BC and offer the new feature/behavior.
> I'm not against reverting the commit,
Reverting the commit, will be a pity
> I suggest not to set unmatched subpatterns at all,
Can you give an example of expected output ?
(I think stable position for matched pattern is important)
php -r 'var_dump(preg_match("/(a)?([a-z]*)(\d*)/", "123", $matches),
$matches);'
Remi.
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc