Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:42374 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 72750 invoked from network); 26 Dec 2008 02:17:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Dec 2008 02:17:30 -0000 Authentication-Results: pb1.pair.com header.from=scott@macvicar.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=scott@macvicar.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain macvicar.net from 193.227.246.108 cause and error) X-PHP-List-Original-Sender: scott@macvicar.net X-Host-Fingerprint: 193.227.246.108 ip246-108-v193.static.x-ip.net Received: from [193.227.246.108] ([193.227.246.108:55111] helo=lovelace.midden.org.uk) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 36/A1-60388-8BE34594 for ; Thu, 25 Dec 2008 21:17:29 -0500 Received: from cpc4-ersk1-0-0-cust50.renf.cable.ntl.com ([81.101.148.51] helo=[192.168.1.138]) by lovelace.midden.org.uk with esmtpsa (TLS-1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.69) (envelope-from ) id 1LG2GR-0006Mh-Cy; Fri, 26 Dec 2008 02:17:25 +0000 Cc: PHP internals Message-ID: <16F9D1D0-9E32-4BDF-AB0A-FBF0AC15E3EE@macvicar.net> To: David Grudl In-Reply-To: <49543783.50309@grudl.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Date: Fri, 26 Dec 2008 02:17:17 +0000 References: <49543783.50309@grudl.com> X-Mailer: Apple Mail (2.930.3) X-Spam-Score: -4.4 X-Spam_Report: Spam detection software, running on the system "lovelace.midden.org.uk", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On 26 Dec 2008, at 01:46, David Grudl wrote: > This code throws *Fatal error*: Method test::__toString() must not > throw an exception > > class Test1 > { > public function __toString() > { > throw new Exception; > } > } > > The same problem causes throwing exceptions in function __autoload. > > I think this behavior is against the logic of exceptions. Excellent > feature of PHP 5.3 would be to resolve this errors. > > [...] Content analysis details: (-4.4 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.8 ALL_TRUSTED Passed through trusted hosts only via SMTP -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] Subject: Re: [PHP-DEV] Tip for 5.3: exceptions in __toString and __autoload From: scott@macvicar.net (Scott MacVicar) On 26 Dec 2008, at 01:46, David Grudl wrote: > This code throws *Fatal error*: Method test::__toString() must not > throw an exception > > class Test1 > { > public function __toString() > { > throw new Exception; > } > } > > The same problem causes throwing exceptions in function __autoload. > > I think this behavior is against the logic of exceptions. Excellent > feature of PHP 5.3 would be to resolve this errors. > > This is down to the design of the engine, we perform casting to strings in a lot of different places and it couldn't be guaranteed that the engine would handle any exceptions correctly. I'm pretty sure there is something in the internals archives about this change. Scott