Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69775 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 54826 invoked from network); 22 Oct 2013 18:32:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Oct 2013 18:32:51 -0000 Authentication-Results: pb1.pair.com header.from=bof@bof.de; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=bof@bof.de; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain bof.de designates 80.242.145.70 as permitted sender) X-PHP-List-Original-Sender: bof@bof.de X-Host-Fingerprint: 80.242.145.70 mars.intermailgate.com Received: from [80.242.145.70] ([80.242.145.70:39568] helo=mars.intermailgate.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 03/F9-10840-EC4C6625 for ; Tue, 22 Oct 2013 14:32:50 -0400 Received: (qmail 24354 invoked by uid 1009); 22 Oct 2013 20:32:43 +0200 Received: from 209.85.212.49 by mars (envelope-from , uid 89) with qmail-scanner-1.25-st-qms (clamdscan: 0.96.2/17988. spamassassin: 3.3.1. perlscan: 1.25-st-qms. Clear:RC:1(209.85.212.49):. Processed in 0.078202 secs); 22 Oct 2013 18:32:43 -0000 X-Antivirus-MYDOMAIN-Mail-From: bof@bof.de via mars X-Antivirus-MYDOMAIN: 1.25-st-qms (Clear:RC:1(209.85.212.49):. Processed in 0.078202 secs Process 24347) Received: from mail-vb0-f49.google.com (gmail@bof.de@209.85.212.49) by mars.intermailgate.com with RC4-SHA encrypted SMTP; 22 Oct 2013 20:32:43 +0200 Received: by mail-vb0-f49.google.com with SMTP id w16so5156975vbb.8 for ; Tue, 22 Oct 2013 11:32:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=WeaXQ4my54T94IKkvtMJP61bFRqWQPhQ1vumyuKKl+A=; b=UstsltxwWciAZyCEo6FYP3Uy0XIcNNcIkTOl77aCvJ5ZcuwUO2ETNLzg/vwj9N8+c0 BR2oW0xAMJdeRPghGhK6R7l+s+2rLa6HXHm7E/WUvowKZ+84rkFbC0aQ990chCwDlXSf NU36/S+mY8W1z8K6+2Oi0OxpRYK/0sd50J3pUSr0QeOOGxSnvQyNP2Bs+6SoaXpMccLM jBOXdF3IoHyc7QqG5EU4uYiXk/cK2ss+gUosliEw7be2zuCdci4Ttm5+pNXEiTc504TL DNA59A0e/Kl/grko2ByHSGog6I4ZLoTt2xinRkc4qk+m9YlTL4CsKxmJcSKQBIveKmvD thAQ== MIME-Version: 1.0 X-Received: by 10.58.29.37 with SMTP id g5mr333245veh.38.1382466761970; Tue, 22 Oct 2013 11:32:41 -0700 (PDT) Received: by 10.52.185.102 with HTTP; Tue, 22 Oct 2013 11:32:41 -0700 (PDT) Received: by 10.52.185.102 with HTTP; Tue, 22 Oct 2013 11:32:41 -0700 (PDT) In-Reply-To: <5266BECD.8000204@php.net> References: <3D.BC.23638.84CA1625@pb1.pair.com> <5264FE65.8050808@php.net> <5266B6A8.4010607@pthreads.org> <5266BECD.8000204@php.net> Date: Tue, 22 Oct 2013 20:32:41 +0200 Message-ID: To: Joe Watkins Cc: Adam Harvey , internals Content-Type: multipart/alternative; boundary=047d7b6786fe42debe04e958a07c Subject: Re: [PHP-DEV] RFC: Expectations From: bof@bof.de (Patrick Schaaf) --047d7b6786fe42debe04e958a07c Content-Type: text/plain; charset=ISO-8859-1 Am 22.10.2013 20:07 schrieb "Joe Watkins" : > > You can catch exceptions, and log them. > You can do that without impacting everything around you, you can do that, or whatever else you like. You can do that handling when you have only a few toplevel scripts, like when you have a setup with a small number of toplevel controllers and almost no CLI stuff around. But due to the scoped nature of try/catch you cannot reasonably / painlessly do that when you have 270 toplevel web and CLI entry points that then each need such a try/catch block. Also, there is the problem with catch (Exception) blocks, which you might easily dismiss as bad form, but which I'm sure are widespread in the field - I certainly know they are in our codebase... On the other hand, setup of an assertion-failed callback can easily go into an auto_prepend file, or into any other standard include (autoloader or something) you might have - exactly because it is something done on the global level instead of the scoped try/catch requirement. And IF you like the exception thing you can make that callback throw whatever you like - but you do not force that model on everybody. Furthermore such an assertion-failed callback has exactly the same change of looking at backtraces, so touting that as a singular feature of the exception approach is not valid. Finally, with the exception approach it is simply not true that it will completely go away in production - because these try/catch blocks will be present for any code that wants to handle the issue, and you cannot make those go away. I'm all for an assert alternative that works with expressions instead of eval, and that completely goes away in the opcode (cache) when disabled in production. best regards Patrick --047d7b6786fe42debe04e958a07c--