Newsgroups: php.doc,php.internals Path: news.php.net Xref: news.php.net php.doc:969383042 php.internals:54421 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92090 invoked from network); 6 Aug 2011 09:30:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Aug 2011 09:30:49 -0000 Authentication-Results: pb1.pair.com header.from=rquadling@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rquadling@gmail.com; spf=pass; 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:65114] helo=mail-qw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6F/44-57891-7C90D3E4 for ; Sat, 06 Aug 2011 05:30:47 -0400 Received: by qwi4 with SMTP id 4so1849647qwi.29 for ; Sat, 06 Aug 2011 02:30:44 -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=XXfQym04QfndTI8KdC5nVlJ1Daz7YFrAj61LmtzTPUc=; b=mjP5OwzNE71UoiElk92MM5KYF7/R+CH16AOOIZLdpgStiW1e22mAMyHQ7gkwf/msMY EfLpuM7wvSqopGu0pnAoqnRT7J/ZfmvX1KOuRhezbc+FbcPOkU1O9K+qSdA8IJvAFbuo 4hJSsIa3rPnhtju38tod4ove9qrtsXqibNMnE= Received: by 10.229.238.201 with SMTP id kt9mr2596062qcb.27.1312623044236; Sat, 06 Aug 2011 02:30:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.81.14 with HTTP; Sat, 6 Aug 2011 02:30:21 -0700 (PDT) Reply-To: RQuadling@GMail.com In-Reply-To: <4E388D9B.80701@sugarcrm.com> References: <4E388D9B.80701@sugarcrm.com> Date: Sat, 6 Aug 2011 10:30:21 +0100 Message-ID: To: Stas Malyshev Cc: Etienne Kneuss , PHP internals , PHP Documentation List Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] asString() method vs __toString() magic method. From: rquadling@gmail.com (Richard Quadling) On 3 August 2011 00:51, Stas Malyshev wrote: > Hi! > > On 8/2/11 7:51 AM, Etienne Kneuss wrote: >> >> The (historic) reason is that the toString conversion occurs at >> various places in the engine, and in some of them, throwing exceptions >> caused trouble. It is not clear whether this limitation it still >> required. In any case, it could almost certainly be fixed. > > In theory, yes. In practice, that means ensuring every place in the engine > that does convert_to_string() can be safely interrupted by an exception and > can handle that exception properly. This is pretty hard to do. > -- > Stanislav Malyshev, Software Architect > SugarCRM: http://www.sugarcrm.com/ > (408)454-6900 ext. 227 > What would be a good way to explain this in the documentation. Just saying that you can't is only going to present more questions. Explaining it a way that isn't too technical, but covers the basis would be good. -- Richard Quadling Twitter : EE : Zend : PHPDoc @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea