Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54292 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66418 invoked from network); 2 Aug 2011 15:56:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Aug 2011 15:56:31 -0000 Authentication-Results: pb1.pair.com smtp.mail=rquadling@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rquadling@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.42 as permitted sender) X-PHP-List-Original-Sender: rquadling@gmail.com X-Host-Fingerprint: 209.85.216.42 mail-qw0-f42.google.com Received: from [209.85.216.42] ([209.85.216.42:56080] helo=mail-qw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 90/A0-63222-D2E183E4 for ; Tue, 02 Aug 2011 11:56:30 -0400 Received: by qwi4 with SMTP id 4so3859355qwi.29 for ; Tue, 02 Aug 2011 08:56:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=aLpGxYl8wvgyPd4oP6b/G6PgvQfsktbRBFK/5Ha9l9I=; b=rjf7JQA7NoGrMzAo71ZAVCy8GF0s+a/wpWCtH0VGZqLK2y8Wb/6S4Y4Ws43bCumGNI nH6ooJLbn7cj5gpQviACxA/LtCqyEPcVuUC3HRDR6r+aTta42FubmLaz8H13/EQZnayP ZgIWcrAnk3At1BkadOssQNByDwUW08JHX8nJ8= Received: by 10.229.217.72 with SMTP id hl8mr4403073qcb.65.1312300587151; Tue, 02 Aug 2011 08:56:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.81.14 with HTTP; Tue, 2 Aug 2011 08:56:07 -0700 (PDT) Reply-To: RQuadling@GMail.com In-Reply-To: References: Date: Tue, 2 Aug 2011 16:56:07 +0100 Message-ID: To: Keloran Cc: Etienne Kneuss , PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] asString() method vs __toString() magic method. From: rquadling@gmail.com (Richard Quadling) On 2 August 2011 16:09, Keloran wrote: > i didnt think any of the magic functions could throw exceptions All magic methods can throw exceptions except __toString. There is some oddity with __set_state() (in terms of the pattern of output is different). http://pastebin.com/nGkP7kKf outputs ... In : failure2::__construct Thrown exception in : failure2::__construct In : failure1::__get Thrown exception in : failure1::__get In : failure1::__set Thrown exception in : failure1::__set In : failure1::__call Thrown exception in : failure1::__call In : failure1::__callStatic Thrown exception in : failure1::__callStatic In : failure1::__isset Thrown exception in : failure1::__isset In : failure1::__unset Thrown exception in : failure1::__unset In : failure1::__invoke Thrown exception in : failure1::__invoke In : failure1::__clone Thrown exception in : failure1::__clone DateTime::__set_state(array( 'date' => '2011-08-02 16:54:03', 'timezone_type' => 3, 'timezone' => 'Europe/London', )) In : failure3::__destruct Thrown exception in : failure3::__destruct In : failure1::__sleep Thrown exception in : failure1::__sleep In : failure1::__wakeup Thrown exception in : failure1::__wakeup But __toString() throws a Fatal Error. -- Richard Quadling Twitter : EE : Zend : PHPDoc @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea