Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:5822 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 29375 invoked by uid 1010); 30 Nov 2003 11:34:08 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 29351 invoked from network); 30 Nov 2003 11:34:08 -0000 Received: from unknown (HELO sunshine.home) (62.178.227.34) by pb1.pair.com with SMTP; 30 Nov 2003 11:34:08 -0000 Received: from mfischer by sunshine.home with local (Exim 4.22) id 1AQPX1-0003Qw-8r for internals@lists.php.net; Sun, 30 Nov 2003 12:14:27 +0100 Date: Sun, 30 Nov 2003 12:14:27 +0100 To: internals@lists.php.net Message-ID: <20031130111427.GC11802@gjat.josefine.at> Mail-Followup-To: Markus Fischer , internals@lists.php.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Editor: Vim http://www.vim.org/ X-PGP-Key: 0xC2272BD0 at wwwkeys.eu.pgp.net X-PGP-Fingerprint: D3B0 DD4F E12B F911 3CE1 C2B5 D674 B445 C227 2BD0 User-Agent: Microsoft Outlook Express 5.50.4807.1700.314 X-Spamfilter: Fighting it with http://www.spamassassin.org/ and http://razor.sourceforge.net/ Subject: Exception without message yields wierd wording in error message From: mfischer@gjat.josefine.at (Markus Fischer) When I throw an exception which is derived from the internal Exception class and implement __toString but do not return a value, the reported error (in case I don't catch the exception) is: Fatal error: Uncaught thrown in /home/mfischer/htdocs/php5/MySQL.php on line 8 i.e. the word 'exception' is missing (and there's redundant line break it seems). Example is from: If I throw some other object not derived from Exception (e.g. stdClass) I get this (which makes more sense): $ php -r 'throw new stdClass;' Fatal error: Uncaught exception 'stdClass' in Unknown on line 0 What I want to say is, that I think it would be a good idea to print out "Fatal error: Uncaught exception '' thrown in .." even if __toString is not implemented. Just for consistency. Another thing I observed is the preserving of the case of the classname. If I throw e.g. stdClass, the case is preserved; but not if I throw my own class: $ php -r 'throw new stdClass;' Fatal error: Uncaught exception 'stdClass' in Unknown on line 0 versus $ php -r 'class MyEx extends Exception {}; throw new MyEx;' Fatal error: Uncaught exception 'myex' with message 'Unknown exception' in Command line code:1 Stack trace: #0 {main} thrown in Command line code on line 1 This all may be sound like nitpicking but I think for consistency and if it's not too complex these small things should be looked into. cheers, - Markus