Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83311 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 24569 invoked from network); 20 Feb 2015 15:29:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Feb 2015 15:29:48 -0000 Authentication-Results: pb1.pair.com smtp.mail=pthreads@pthreads.org; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=pthreads@pthreads.org; sender-id=unknown Received-SPF: error (pb1.pair.com: domain pthreads.org from 209.85.192.176 cause and error) X-PHP-List-Original-Sender: pthreads@pthreads.org X-Host-Fingerprint: 209.85.192.176 mail-pd0-f176.google.com Received: from [209.85.192.176] ([209.85.192.176:42211] helo=mail-pd0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0D/81-14173-8E257E45 for ; Fri, 20 Feb 2015 10:29:48 -0500 Received: by pdbfp1 with SMTP id fp1so8241850pdb.9 for ; Fri, 20 Feb 2015 07:29:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=kPPsVDJln2+jM9QMnQyhg8jMx+F9Cf3WoiveaAgzcVk=; b=A2qQJ/nSP0k2yN655zepxqDN9kkwdYRhDG0DXq5A8PzMGKQ0qDmczi2np8mJwMrrN4 r6Ndjwnm5F9YeIzO3XoKLLDnitRwrjvZSepAAU1hw23NVXemMTlib53MZ2P89pYV9pph NMCFckkoIR70zoDz5dw0+2VmdTpzU7ZLjgZjPiA3qcKwJb/NIzCT5sjjTXIc74WHv7ee V7O1nk2NMCc9aOTG1+6ZMUx5fMm0kouBPyhYpyFGcrgtIf4t8WCO+y2a63Y8xKe29tCF HKx5o+DWcBwbe/2nqF6eOZhI8MH8rwDSxQwEqXlX+4ChLCxCDmEcLvAUdCfe1pny+PpI KmIg== X-Gm-Message-State: ALoCoQnEd7pt7jbT497XUg6aEcjpv7sQHaz+KBnrM9ckSEo6PJLxARy6PPxVYdsIe4aBDpYiFF/9 MIME-Version: 1.0 X-Received: by 10.66.185.230 with SMTP id ff6mr17735378pac.102.1424446182338; Fri, 20 Feb 2015 07:29:42 -0800 (PST) Received: by 10.70.49.100 with HTTP; Fri, 20 Feb 2015 07:29:42 -0800 (PST) X-Originating-IP: [86.159.154.191] In-Reply-To: <54E74ADF.9040608@googlemail.com> References: <54E5F77D.9090406@fischer.name> <54E6F48A.9040906@fischer.name> <54E72FE7.9030803@googlemail.com> <54E7312D.9090404@googlemail.com> <54E73E70.5020403@googlemail.com> <54E74ADF.9040608@googlemail.com> Date: Fri, 20 Feb 2015 15:29:42 +0000 Message-ID: To: Crypto Compress Cc: PHP Developers Mailing List Content-Type: multipart/alternative; boundary=001a1134259ab343b5050f86b8bf Subject: Re: [PHP-DEV] [VOTE] Expectations From: pthreads@pthreads.org (Joe Watkins) --001a1134259ab343b5050f86b8bf Content-Type: text/plain; charset=UTF-8 > However I think it is pre mature to vote on as there was (sorry) not explicit discussions about it. I haven't heard that from anyone else, the RFC is plenty old. > A couple of things are unclear. See the numerous questions in this thread. > I also do not like other things. These don't seem like valid reasons to hold off progress. > zend.assertions: Having a more general debug setting might be a good idea, but is outside of the scope of this RFC. > assert.exceptions: Delay isn't necessary, exceptions are not used by default, and there is plenty of time for Engine Exceptions to make necessary changes. Cheers Joe On Fri, Feb 20, 2015 at 2:55 PM, Crypto Compress < cryptocompress@googlemail.com> wrote: > Am 20.02.2015 um 15:09 schrieb Nikita Popov: > >> On Fri, Feb 20, 2015 at 3: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. >> >> >> The point behind AssertionException is that >> a) It will leave the scope where with the failed assertion immediately. A >> warning would continue running the code, even though some precondition is >> violated, which doesn't make sense. >> > > Assumed context is wrong here. > - exception in development: error > - no exception in production: warning, zero cost nothing > > Rephrased: A zero-cost non-existing exception would continue running the > code, ... > > In a previous email you brought up the point if or not derive AssertionEx > from Exception. I argue that all child exception MUST BE derived from > Exception. Any exception to this is not an Exception. (my english is too > limited to explain this, sorry) > > > b) It can still be gracefully handled (unlike a fatal error). E.g. the >> unit testing framework can catch it, so you can continue running all your >> tests even if one causes an assertion failure. >> > > Unit test frameworks do this already. No change here. > > > When Joe says "not intended to be caught" this is referring to "normal" >> code. Catching them at the top-level still makes sense, e.g. for the unit >> testing case mentioned or even just to print a nice error message with >> extra information. Using an exception instead of a fatal error also means >> that things like "finally" will still run, so your code can still release >> locks etc even if an assertion failure occurred. >> > > In production this will never happen. We go round in circles here. I am > aware of you preference on "exceptions everywhere". > > > >> Nikita >> > > --001a1134259ab343b5050f86b8bf--