Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:26095 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 94061 invoked by uid 1010); 19 Oct 2006 20:20:42 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 94046 invoked from network); 19 Oct 2006 20:20:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Oct 2006 20:20:42 -0000 Authentication-Results: pb1.pair.com header.from=brianm@dealnews.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=brianm@dealnews.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain dealnews.com designates 129.41.69.185 as permitted sender) X-PHP-List-Original-Sender: brianm@dealnews.com X-Host-Fingerprint: 129.41.69.185 smtp.dealnews.com Linux 2.5 (sometimes 2.4) (4) Received: from [129.41.69.185] ([129.41.69.185:49711] helo=smtp.dealnews.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 07/AC-27040-81ED7354 for ; Thu, 19 Oct 2006 16:20:41 -0400 Received: (qmail 19470 invoked from network); 19 Oct 2006 16:20:37 -0400 Received: from unknown (HELO ?10.1.6.4?) (10.1.6.4) by -H with SMTP; 19 Oct 2006 16:20:37 -0400 Message-ID: <4537DE0E.7030003@dealnews.com> Date: Thu, 19 Oct 2006 15:20:30 -0500 User-Agent: Thunderbird 1.5.0.2 (Macintosh/20060406) MIME-Version: 1.0 To: evert@rooftopsolutions.nl CC: Rasmus Lerdorf , internals@lists.php.net References: <4537C21F.9070900@rooftopsolutions.nl> <4537D328.6080706@lerdorf.com> <4537DBEC.8050506@rooftopsolutions.nl> In-Reply-To: <4537DBEC.8050506@rooftopsolutions.nl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Feature request: ini setting for http 500 on fatal errors From: brianm@dealnews.com (Brian Moon) Evert | Rooftop wrote: > Thats a smart idea.. I like that > > As for letting PHP do the 500, I tend to use output buffering everywhere > (i think most people do, supposed to be faster too) so I'm used to > setting header()'s wherever I need them.. You think wrong. There are very good reasons not to use output buffering. > Besides, in most of my script the business logic gets executed first, > and this is where most errors can happen.. only after the presentation > is done. > > So the solution would be, if fatal error is triggered, and > headers_sent() is false then set the error to 500.. This produces inconsistent behavior. I would not be in favor of it. I suggest you do as Rasmus suggested. Use register_shutdown_function() perhaps to have a function to change the status code before output is sent in your specific environment. -- Brian Moon ------------- http://dealnews.com/ It's good to be cheap =)