Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99051 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57929 invoked from network); 15 May 2017 15:49:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 May 2017 15:49:12 -0000 Authentication-Results: pb1.pair.com smtp.mail=remi@fedoraproject.org; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=remi@fedoraproject.org; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fedoraproject.org from 217.70.183.201 cause and error) X-PHP-List-Original-Sender: remi@fedoraproject.org X-Host-Fingerprint: 217.70.183.201 relay8-d.mail.gandi.net Received: from [217.70.183.201] ([217.70.183.201:58859] helo=relay8-d.mail.gandi.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CA/6D-15531-5FDC9195 for ; Mon, 15 May 2017 11:49:11 -0400 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by relay8-d.mail.gandi.net (Postfix) with ESMTPS id 4B4F9406C8 for ; Mon, 15 May 2017 17:49:07 +0200 (CEST) Received: from mfilter33-d.gandi.net (mfilter33-d.gandi.net [217.70.178.164]) by relay5-d.mail.gandi.net (Postfix) with ESMTP id 2308541C084 for ; Mon, 15 May 2017 17:49:07 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter33-d.gandi.net Received: from relay5-d.mail.gandi.net ([IPv6:::ffff:217.70.183.197]) by mfilter33-d.gandi.net (mfilter33-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id 9LLWZL_9JUvl for ; Mon, 15 May 2017 17:49:05 +0200 (CEST) X-Originating-IP: 90.109.100.243 Received: from builder.remirepo.net (LFbn-1-6148-243.w90-109.abo.wanadoo.fr [90.109.100.243]) (Authenticated sender: contact@ll-experts.com) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 595A841C08F for ; Mon, 15 May 2017 17:49:05 +0200 (CEST) To: internals@lists.php.net References: Message-ID: <1822acea-b6df-35bf-c760-7d1d06a3d88f@fedoraproject.org> Date: Mon, 15 May 2017 17:49:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="S4ijGTjOtKAUo0XT8lbrodErwcsgf948G" Subject: Re: [PHP-DEV] BC break in master (7.2) - Distinguish between unmatched subpatterns and empty matches in preg_*() From: remi@fedoraproject.org (Remi Collet) --S4ijGTjOtKAUo0XT8lbrodErwcsgf948G Content-Type: multipart/mixed; boundary="MnWtuagqJwE8JjIT6nBDt29UUvcxhPSFH"; protected-headers="v1" From: Remi Collet To: internals@lists.php.net Message-ID: <1822acea-b6df-35bf-c760-7d1d06a3d88f@fedoraproject.org> Subject: Re: [PHP-DEV] BC break in master (7.2) - Distinguish between unmatched subpatterns and empty matches in preg_*() References: In-Reply-To: --MnWtuagqJwE8JjIT6nBDt29UUvcxhPSFH Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Le 15/05/2017 =C3=A0 08:57, Nicolas Grekas a =C3=A9crit : > Hi, >=20 > in master, feature request https://bugs.php.net/61780 has been implemen= ted > and merged into master thanks to https://github.com/php/php-src/pull/13= 03 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. --MnWtuagqJwE8JjIT6nBDt29UUvcxhPSFH-- --S4ijGTjOtKAUo0XT8lbrodErwcsgf948G Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlkZze4ACgkQYUppBSnxahgvMQCg9ikjY5JW+yDlR+H58H7jkL1A KUIAn1Twe+8MULFP8qppi6zLG5Db+Fh1 =WZzj -----END PGP SIGNATURE----- --S4ijGTjOtKAUo0XT8lbrodErwcsgf948G--