Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103079 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 564 invoked from network); 11 Aug 2018 12:30:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Aug 2018 12:30:57 -0000 Authentication-Results: pb1.pair.com header.from=cmbecker69@gmx.de; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=cmbecker69@gmx.de; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmx.de designates 212.227.15.19 as permitted sender) X-PHP-List-Original-Sender: cmbecker69@gmx.de X-Host-Fingerprint: 212.227.15.19 mout.gmx.net Received: from [212.227.15.19] ([212.227.15.19:55897] helo=mout.gmx.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E3/10-32660-9F6DE6B5 for ; Sat, 11 Aug 2018 08:30:51 -0400 Received: from [192.168.2.102] ([87.167.201.185]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MXr3H-1fR2K92tdv-00WrL8; Sat, 11 Aug 2018 14:30:46 +0200 To: "Jesse G. Donat" , internals@lists.php.net References: Message-ID: <72f6c9c7-10e4-c616-5d1e-7d998e7cc4bb@gmx.de> Date: Sat, 11 Aug 2018 14:30:47 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:IdSV1IhHlGHpvYfP0tX0frF9XXw5seBpZxd0WAqqXmaS2oqzvHX i6kWlzZS5pT5F/8kbzQFivVb+j0GZvewPtAjDib5FNGqXY65mGbk2zDzzXj/BIoZAeYO242 qYODU5GVmvj3kTioVM3xHJR00SEOu7QOe20sbvJT61Penr1DHMz5O/JBvo49JyrUEyFMNCm M7FMrNbGbwPd+nDfGWPCw== X-UI-Out-Filterresults: notjunk:1;V01:K0:E01iZncwB2k=:+r6NMLjNplpIai1jXm2gEW zj8gmtEJ3kfr3Y4DMZIxig5zLFVyU96IQTFa3PqAtRbDe0VbJ6pu3J+FfwPReN53wy3qR4RzY k3YenV9IPN5K/m68pwA5L30C7WhV/KCLGpxHBgGfO70Tr8JMwKGOsHe/x19oNK+tH2zjWAcPK mzTYVPQe97D362SklewBMxYTHT4Acr+gmnZTP5lISWPPagLaoWmz6GGJL8yT+55mS0036Oa62 KyoOgbu7HO8hU3y1VarTH4rZdsx4UyZFhKGO58h22p9AilH+jR8FqYRwiwlq+BMPQ/Yx3CSTe 7t2U9ip22dC5apLicIm5ScMLplDo4L5boXKD0zZ7896sfwb8EkmGtSDOOxMqQHj+Atzm08yhx n/a0spOX14GlIDQmD33bUfaM/vl8j022IEMj17+/ie3zeK5y8Qvi6iwZPjRwN+g1yRoUSUGid 291bsigkhq6teBV0dUyLsylBk7FUGqsHpxv6A64CBXoyL6SQM25rXqKm7KTMip+aF7SACbvEs AJLd1BzZvaGECLfU0OcwOKDGVUoRyvrWOGw5nUDaeSdW3GA8SO8Mcu0+b0vqcMC5vigyOVUG8 R3SASjkTsUw/Z7AdvXpp+x7ppiFWtV1r0irmMCaZnIDOyrK9ZMTHIX9MSBCIRXAiXJqiWT6k5 EhDNL7ryqIrFWreQ1nI0nYItVUh2CIcMGYoEJ887UJ65CrJgqF7xySozgfWTPxwJvn8EQ31p2 cQxkNMnUJaXvMegzUiXpcLeRP07F0xOV3vUO8GN0AdTlJR1Ka1EyhnuoPieD1VT8yBIZaIf+U E5jURzQ Subject: Re: RFC Proposal From: cmbecker69@gmx.de ("Christoph M. Becker") On 10.08.2018 at 22:15, Jesse G. Donat wrote: > I'm measuring reaction for an RFC > > Essentially right now preg regex's fail silently - and you have to > actually check them manually with preg_last_error - something I've > never actually seen done in code. > > see: > > https://github.com/php/php-src/pull/2910 > https://bugs.php.net/bug.php?id=70110 > https://bugs.exim.org/show_bug.cgi?id=1663 > > I'd like to propose that, in line with the recent JSON changes, the > preg methods be made to throw exceptions (or at the very least - > warnings) rather than fail silently as I believe this is a bad > behaviour. > > I personally do not have the low level coding knowledge needed to do > this, nor do I personally know anyone who does, so I would be > submitting this as a "concept" > > > Thank you ahead of time! > > This will be my first RFC submission, so I hope I'm doing this right. Thanks for bringing this up. In principle, I'd like better feedback for failing PCRE functions, but I'm rather concerned regarding the BC break. For json_(en|de)code() it was simple to just add another option flag, but some of the PCRE functions (e.g. preg_replace()) do not have an $options/$flags parameter yet, but already too many (optional) parameters. Perhaps it would be best to postpone this to PHP 8, where additional warnings, and maybe even exceptions, would be acceptable. Anyhow, the implementation might be as simple as . -- Christoph M. Becker