Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103081 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 6148 invoked from network); 11 Aug 2018 13:57:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Aug 2018 13:57:23 -0000 Authentication-Results: pb1.pair.com smtp.mail=me@kelunik.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=me@kelunik.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain kelunik.com from 85.215.255.25 cause and error) X-PHP-List-Original-Sender: me@kelunik.com X-Host-Fingerprint: 85.215.255.25 mo4-p00-ob.smtp.rzone.de Received: from [85.215.255.25] ([85.215.255.25:31463] helo=mo4-p00-ob.smtp.rzone.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C9/D0-32660-14BEE6B5 for ; Sat, 11 Aug 2018 09:57:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1533995838; s=strato-dkim-0002; d=kelunik.com; h=Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=6Fi6R3RJ4uFQ1/4LPACDLDnm/eUBkGR8JUwIemHIMnw=; b=F9SWNkAfwQTwUrLqXVTG8r7ao4l6Nv7aZ9tQ5RWSGWdPgex3YJLtK9yy29nWHy5dXY oMHjpO4wdx8on/7gY3iLpPt9pofHxaaLqFPlQUpDVdBd4Jnuhg3AoqbWnjhTl7CoVtkB FxdETVffNbZUOPu0vroTctm9wNlSXhYXOicKOEiAalwJ/i0bUyiUNw0ML3ZC85PDvFYy pgf1sjH5TjHBtXW+JTbS3r7IEYGwsHLJf1qFJMJ0zmMz0XH4AL05l17T4QX5RexyTtFF 5TDhpZDctgbLgymNB/DTCQ9X18jnfUhIwh8gmsNtuu1JHqhmgikO+kNl+POOuwR3NzH0 oEQA== X-RZG-AUTH: ":IWkkfkWkbvHsXQGmRYmUo9mlsGbEv0XHBzMIJSS+jKTzde5mDb8Db2nUQi7a" X-RZG-CLASS-ID: mo00 Received: by mail-yw1-f52.google.com with SMTP id s68-v6so10614105ywg.2 for ; Sat, 11 Aug 2018 06:57:18 -0700 (PDT) X-Gm-Message-State: AOUpUlFfBEinfg6flwFmglUDvKCeZuU61INuCa4h4/YxA3S3ZgXL+4KT Pmtg9ztdGykyijQ9uRAbbIelqWtxb+z6Nysdmlk= X-Google-Smtp-Source: AA+uWPzGofv5KqGuyuE7jXV2X/U2HdUPb6TyYmtVi2DwJQlOCpg9LqQ5nkUBlaFuH7E6uc8uAmdTN6Cmh41HujdgDWQ= X-Received: by 2002:a81:4644:: with SMTP id t65-v6mr5556790ywa.463.1533995838081; Sat, 11 Aug 2018 06:57:18 -0700 (PDT) MIME-Version: 1.0 References: <72f6c9c7-10e4-c616-5d1e-7d998e7cc4bb@gmx.de> In-Reply-To: <72f6c9c7-10e4-c616-5d1e-7d998e7cc4bb@gmx.de> Date: Sat, 11 Aug 2018 15:57:07 +0200 X-Gmail-Original-Message-ID: Message-ID: To: Christoph Becker Cc: donatj@gmail.com, PHP Internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] Re: RFC Proposal From: me@kelunik.com (Niklas Keller) I'd be fine with throwing exceptions in PHP 7.4, but maybe a warning in PHP 7.4 and an exception in 8.0 then? Things like that can be a pretty stupid error that doesn't get noticed, and there are probably not many use cases checking the return to be false and then not throwing an exception. Regards, Niklas Am Sa., 11. Aug. 2018 um 14:30 Uhr schrieb 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 > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >