Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:66730 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 27907 invoked from network); 20 Mar 2013 20:02:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Mar 2013 20:02:30 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierre@pcservice.co.za; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pierre@pcservice.co.za; sender-id=pass Received-SPF: pass (pb1.pair.com: domain pcservice.co.za designates 67.18.14.11 as permitted sender) X-PHP-List-Original-Sender: pierre@pcservice.co.za X-Host-Fingerprint: 67.18.14.11 gateway06.websitewelcome.com Linux 2.6 Received: from [67.18.14.11] ([67.18.14.11:35499] helo=gateway06.websitewelcome.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5A/BD-46127-2D51A415 for ; Wed, 20 Mar 2013 15:02:29 -0500 Received: by gateway06.websitewelcome.com (Postfix, from userid 5007) id 5CA69BF8B95F6; Wed, 20 Mar 2013 15:02:23 -0500 (CDT) Received: from vinacomin.websitewelcome.com (vinacomin.websitewelcome.com [50.97.101.199]) by gateway06.websitewelcome.com (Postfix) with ESMTP id 4ED05BF8B95B7 for ; Wed, 20 Mar 2013 15:02:23 -0500 (CDT) Received: from [209.85.216.54] (port=39760 helo=mail-qa0-f54.google.com) by vinacomin.websitewelcome.com with esmtpsa (TLSv1:RC4-SHA:128) (Exim 4.80) (envelope-from ) id 1UIPDL-0004gQ-6q for internals@lists.php.net; Wed, 20 Mar 2013 15:02:23 -0500 Received: by mail-qa0-f54.google.com with SMTP id hg5so1266136qab.20 for ; Wed, 20 Mar 2013 13:02:22 -0700 (PDT) X-Received: by 10.224.198.136 with SMTP id eo8mr7588124qab.47.1363809742592; Wed, 20 Mar 2013 13:02:22 -0700 (PDT) MIME-Version: 1.0 Reply-To: pierre@pcservice.co.za Received: by 10.49.129.134 with HTTP; Wed, 20 Mar 2013 13:01:52 -0700 (PDT) In-Reply-To: <514A05BA.90409@gmail.com> References: <514A05BA.90409@gmail.com> Date: Wed, 20 Mar 2013 22:01:52 +0200 Message-ID: To: Matt Pelmear Cc: PHP Development Content-Type: multipart/alternative; boundary=20cf300fb17d3fab8c04d860b3f4 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vinacomin.websitewelcome.com X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - pcservice.co.za X-BWhitelist: no X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (mail-qa0-f54.google.com) [209.85.216.54]:39760 X-Source-Auth: pierre@pcservice.co.za X-Email-Count: 1 X-Source-Cap: cGNzZXJ2aWM7cGllcnJlO3ZpbmFjb21pbi53ZWJzaXRld2VsY29tZS5jb20= Subject: Re: [PHP-DEV] Method check - Can someone create a RFC for it? From: pierre@pcservice.co.za (Pierre du Plessis) --20cf300fb17d3fab8c04d860b3f4 Content-Type: text/plain; charset=ISO-8859-1 On 03/20/2013 11:43 AM, Carlos Rodrigues wrote: > Like Mike emaild me, i can just change my code to something like >> $obj->getImage()->getUrl(), where getImage() will return a mock object >> with getUrl() returning an empty string. >> >> But my request here is not about this case only. >> Imagine you have a web page with 3 blocks of information. Let's say >> "news", "partners" and "blog". >> >> Now if for some reason you didn't code it right, you might get a fatal >> error in one of these "blocks". >> >> I'd love to have a way to try/catch these blocks, Currently i can only >> do this using ajax, or running shell exec "php block.php" for each >> one. >> >> If we could catch fatal errors, or at least the "Call to a member >> function on a non-object", we could have this code in our Zend >> Framework implementations, wrapping each view in a try/catch, and >> showing a "error, sorry", in case the view has errors. >> >> - Carlos >> >> > Carlos, > > You should take a look at the other thread that's been in the internals > group over the last day or so. There is an effort to see cases like this > become E_RECOVERABLE_ERRORs, which I think would address what you're really > looking for. (In fact, this particular error is mentioned first in that > thread.) > > But I would argue that, while this is a change I support, this is not a > substitute for proper testing prior to code deployment (as others have > pointed out). I think changing the fatal error to E_RECOVERABLE_ERROR will be a good option, because if you have a generic error handler, then you won't have to worry about blank pages on a production server --20cf300fb17d3fab8c04d860b3f4--