Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67089 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52358 invoked from network); 16 Apr 2013 16:36:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Apr 2013 16:36:13 -0000 Authentication-Results: pb1.pair.com smtp.mail=chrisw@aquacool.ltd.uk; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=chrisw@aquacool.ltd.uk; sender-id=pass Received-SPF: pass (pb1.pair.com: domain aquacool.ltd.uk designates 77.107.181.84 as permitted sender) X-PHP-List-Original-Sender: chrisw@aquacool.ltd.uk X-Host-Fingerprint: 77.107.181.84 stockport.aquacool.ltd.uk Received: from [77.107.181.84] ([77.107.181.84:58321] helo=stockport.aquacool.ltd.uk) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CD/30-50422-AFD7D615 for ; Tue, 16 Apr 2013 12:36:13 -0400 Received: from DC01.aquacool.local ([fe80::9298:e041:a36d:d691]) by DC01.aquacool.local ([fe80::9298:e041:a36d:d691%11]) with mapi id 14.01.0438.000; Tue, 16 Apr 2013 17:36:08 +0100 To: Thomas Anderson , "internals@lists.php.net" Thread-Topic: [PHP-DEV] trigger_error() enhancements Thread-Index: AQHONJz0+2dc0StTCU+i0UXZx0fwYpjZFO4w Date: Tue, 16 Apr 2013 16:36:07 +0000 Message-ID: <075AE850888292488D400D9632DFE6E102405DE2@DC01.aquacool.local> References: In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [192.168.63.150] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: RE: [PHP-DEV] trigger_error() enhancements From: chrisw@aquacool.ltd.uk (Chris Wright) At 08 April 2013 21:51 Thomas Anderson wrote: > I was thinking it'd be useful if people could switch between throwing > exceptions and displaying errors. If throw were a function and not a > language construct one could do $function($error) where $function was a > string equal to either 'trigger_error' or 'throw'. But alas that's not > possible. function throw_exception($message, $level =3D 0) { throw new Exception($message, $level); } ;-) For the record I think that the PHP errors vs. exceptions model kinda sucks, but I also think that what you propose is even worse (no offence). > Also, I think it'd be useful if developers could specificy which line > number and file name the error [...] displays This I could kind of go with. In particular it would be good to control the file/line no *printed* without affecting the stack trace. If this is done though, I would only want to specify how far up the call stack to go to get this information, rather than actually specifying the values used. Best Regards Chris Wright (DaveRandom)