Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83409 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 55711 invoked from network); 21 Feb 2015 17:53:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Feb 2015 17:53:56 -0000 Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.43 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.192.43 mail-qg0-f43.google.com Received: from [209.85.192.43] ([209.85.192.43:60906] helo=mail-qg0-f43.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 78/7D-08895-236C8E45 for ; Sat, 21 Feb 2015 12:53:54 -0500 Received: by mail-qg0-f43.google.com with SMTP id i50so18914217qgf.2 for ; Sat, 21 Feb 2015 09:53:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=40I5V75S02OMAHH0BpOzFNeI1Q0FdKFUtdjPGN4bnP0=; b=R1YGLyl2wbbH/8IKwsD/SlzrOmpMixYRpf2JZi4WCyoGO7yGJKlRxImcAOUyTqTJnY VLo4EDa0LNoMNcN6xiZRWsQdJxp5w5i5VXC2ab4vOPGmhz6VLAJBnVNy4uK3gnkbU/cI LuEJeQ/Kqzbr7+vlFpr/cKjJeid4lYHgqXdL/ahsU7DNIFL2CrIT7HAUYQo2zNC3Cm3V A/PFpvzn5Qu/edwK+lhmtTGiSsJ/bvSkws/PcK2S9SDfXv5FENdXJI1gLt9fESbMFYDm uwH8VUvFkX5gwklE7E/OHc3tND6rtHzSbozpM0DM1Qn3XZEKduH0RMHrHUcr3WvQZLlT ks/Q== MIME-Version: 1.0 X-Received: by 10.140.95.179 with SMTP id i48mr7662031qge.4.1424541231800; Sat, 21 Feb 2015 09:53:51 -0800 (PST) Received: by 10.96.39.195 with HTTP; Sat, 21 Feb 2015 09:53:51 -0800 (PST) In-Reply-To: References: <54E5F77D.9090406@fischer.name> <54E6F48A.9040906@fischer.name> <54E72FE7.9030803@googlemail.com> <54E7312D.9090404@googlemail.com> <54E73E70.5020403@googlemail.com> Date: Sat, 21 Feb 2015 09:53:51 -0800 Message-ID: To: Yasuo Ohgaki Cc: Crypto Compress , PHP Developers Mailing List Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [VOTE] Expectations From: pierre.php@gmail.com (Pierre Joye) On Fri, Feb 20, 2015 at 7:10 PM, Yasuo Ohgaki wrote: > Hi Crypto, > > On Fri, Feb 20, 2015 at 11:02 PM, Crypto Compress < > cryptocompress@googlemail.com> wrote: > >> AssertionExceptions are not intended to be caught, they are intended to be >>> seen, in a specific environment. >>> >> >> Joe, your argumentation is around how (not) to use exceptions. I can see >> your point and it's valid. >> My point is about not to implement exceptions at all. >> >> If exceptions are not intended to be caught, they don't need to be thrown >> (even if the context is different). >> If exceptions are not thrown and not caught, we can use "error" in dev and >> some easing severity (warning, zero cost nothing) in prod. >> >> Freely adapted from Murphy: If assertion exception can be catched, it will >> be even in production. > > > Assertion is only for development and testing. > We need errors or exceptions during development and testing, but > not in production. Therefore, errors/exception should not be catched > by code in general. Isn't assertion nature? > > I don't insist not to enable assertion in production environment. > There might be software that needs extreme reliability and stability. > For these softwares, it makes sense to enable assertions and catch > errors/exceptions to do some cleanups. This last paragraph makes me wonder why in the world assert in PHP is still anything valid. If anything it should be removed, to be honest. Which softwares do not require to be reliable and stable? Most if not all PHP written software interact with external inputs, be from APIs point of view or from actual users. Per se, they have to be validated and errors handling is part of this validation. I do see some values for asserts in unit tests, but that's pretty much all I can think about it. All in all, I stay with my initial comment, this RFC needs more discussion and some other critical questions must be answered before this RFC. Cheers, -- Pierre @pierrejoye | http://www.libgd.org