Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99039 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28937 invoked from network); 15 May 2017 11:36:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 May 2017 11:36:59 -0000 Authentication-Results: pb1.pair.com smtp.mail=nicolas.grekas@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nicolas.grekas@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.174 as permitted sender) X-PHP-List-Original-Sender: nicolas.grekas@gmail.com X-Host-Fingerprint: 209.85.223.174 mail-io0-f174.google.com Received: from [209.85.223.174] ([209.85.223.174:34398] helo=mail-io0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CD/48-15531-AD299195 for ; Mon, 15 May 2017 07:36:58 -0400 Received: by mail-io0-f174.google.com with SMTP id k91so71254150ioi.1 for ; Mon, 15 May 2017 04:36:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=oRZEn8/BZFTiYJNA2gIXMmU4pTQeaRQVNCFFriee9rI=; b=O701nYeWALMvDdL9i6fW/OwgJVraZRiT2TFkYCGasjo5WnF/4mHLk9PSlqM3qMlsoG LR1OqBXoGkAKa1+lq7CfWQpKFwV60FabGMrjQ7nGRyw1UFCWI6mxHk8wxSyOyljAVa4w aG4/J7KNgGl3dWt3ONcol7C9hWAO4jUYnmax1jqnJWldZWORQARdtgAguSs3lBiuM6kq RlWBBSJ7UojYcpjcvbGlwA5hW2U2feVaV8/MF71dVcBFvVprbKnPR8zq1OfAl9IDH8oK XACjAE5eEx5R8R68Gfhv+nLtOgjvh+h5HX+MLJvER4cCPAx/1Hru4S4UgRsm3OwOlVP3 Xzuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=oRZEn8/BZFTiYJNA2gIXMmU4pTQeaRQVNCFFriee9rI=; b=US4nkZXfGAjbKN2n+wq1nBxSVUmezVtF2YVFXLAQCrClSWOyKZfQCkhtdWM+uAFj6V ezNyjH+9iA0V3aeB8i5ZOAlV0WJmuHmFhtBrRhdmsqy5HUL4w7YAxjbYEdFt+nDgeVtY RTBQcSqXEWI/i8Y+mwpV2Y5lxvmqrc/FAgCni5GUr0EM4Cjs8P1oFteignRWS0FZLbvc CrKAIHGcY5onfdO0aMQldJvCDKFPcFj8BTmEfW8MXyL77cHFZOMJBABSusxCFnzdoNSO jzs4IZJM8fiIwzF+kmhNPJtksW6WPAswbKCzGAOyDsi6sDkXyHxlzC0tS36AZqYmYSR7 LaoA== X-Gm-Message-State: AODbwcCW6VSiGAa+TuiZd0VIZcM8Z0LJG3gZykpCpjgHqC7k43UA5MFH 1hCwesPEHmxDNLSeOeiMuNsMyqB7Mg== X-Received: by 10.107.199.132 with SMTP id x126mr4639901iof.216.1494848215115; Mon, 15 May 2017 04:36:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.130.201 with HTTP; Mon, 15 May 2017 04:36:34 -0700 (PDT) In-Reply-To: References: Date: Mon, 15 May 2017 13:36:34 +0200 Message-ID: To: Pierre Joye Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary="94eb2c11bf86daeed1054f8e78e8" Subject: Re: [PHP-DEV] BC break in master (7.2) - Distinguish between unmatched subpatterns and empty matches in preg_*() From: nicolas.grekas@gmail.com (Nicolas Grekas) --94eb2c11bf86daeed1054f8e78e8 Content-Type: text/plain; charset="UTF-8" Thanks Pierre, 2017-05-15 12:12 GMT+02:00 Pierre Joye : > hi Nicolas, > > On Mon, May 15, 2017 at 1:57 PM, Nicolas Grekas > wrote: > > 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 > > > > But as noted in the PR and even in the UPGRADING file, this is a BC > break: > > . preg_match() and other PCRE functions now distinguish between > unmatched > > subpatterns and empty matches by reporting NULL and "" (empty > string), > > respectively. Formerly, either was reported as empty string. > > > > While trying to run Symfony's test suite against 7.2, we noticed that > this > > BC break is hitting several components badly. If Symfony is hit, there > will > > be many more userland code impacted for sure. > > > > As written explicitly in the releasing policy of php-src, BC breaks must > > not happen in minor versions. Therefore, I'm kindly but strongly asking > for > > this BC break to be reconsidered and removed. > > I agree that a minimum 5 years old possible bug, quite small, causing > BC breaks is not good. As far as the fix is critical or justified, I > think it is sometimes ok to break BC for edge cases. However I do not > see this is not the case here. > > @RMs revert for 7.2 and re evaluate for later? Another possibility would be to make this opt-in, with a new flag. FYI, I quickly spotted at least two places in the code base where we check the matches with something like: if ('' !== $matches[2]) {...} else {...} This should be a pretty common check so the BC break will impact more userland code when released. Cheers, Nicolas --94eb2c11bf86daeed1054f8e78e8--