Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86895 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93575 invoked from network); 26 Jun 2015 06:35:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jun 2015 06:35:56 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.177 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.192.177 mail-pd0-f177.google.com Received: from [209.85.192.177] ([209.85.192.177:36696] helo=mail-pd0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D4/62-57329-CC2FC855 for ; Fri, 26 Jun 2015 02:35:56 -0400 Received: by pdcu2 with SMTP id u2so69028691pdc.3 for ; Thu, 25 Jun 2015 23:35:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=hbnIUifkqgAB13UnsZqXOnzOcdDiBQ/iG05tRHkyJrQ=; b=nOFzwA5ugBVwLTW3DnI8TCU6I3mmPvEV4BxR+Rb59GTm1Hak+qds2y6BiG8OttuW5N GDD6PCFSnqPgtleifYx+qtMwaPFaCKvJqlldH2ZcnBcyzWOckxhkvTb5n5BYIQkEA6Ci Lf9CGuS/hnJG1fyJx9UEOgJlvz5O6/woRExYaq1SiZkxm0LHfl398FkwqiywJIOjmgS3 tUkJUh7sR0UV6FalN+JzphOV0z/kao9gw3yF3wb3kvo7bhn94ZDjJ+xAA+8wxUgbwgLC lOC9tngPxIvqvAUC+dNZ+xF6dOuYDsC0f3XRNtewiF5a6cLlxXtncry4x8XLU/5FraW7 aOBQ== X-Received: by 10.66.236.39 with SMTP id ur7mr31241pac.123.1435300553524; Thu, 25 Jun 2015 23:35:53 -0700 (PDT) Received: from Stas-Air.local (108-66-6-48.lightspeed.sntcca.sbcglobal.net. [108.66.6.48]) by mx.google.com with ESMTPSA id k5sm32140775pda.34.2015.06.25.23.35.50 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Jun 2015 23:35:50 -0700 (PDT) Message-ID: <558CF2C1.4050602@gmail.com> Date: Thu, 25 Jun 2015 23:35:45 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Nikita Popov , PHP internals , Dmitry Stogov References: In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] Allow exceptions in __toString() From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > However what it doesn't do, and what I wouldn't consider feasible to do, is > ensure that every single string conversion in library functions is > exception safe. Personally I don't think this is a blocking issue, as the > worst that can happen is usually an additional superfluous warning to be > thrown, or something similar. If cases like this turn up, we can > specifically target them. This sounds kind of dangerous, especially in combination with convert_to_string. Of course, when using ZPP it's probably fine since ZPP result will be checked, but when not I'm not sure what happens when conversion is initiated otherwise - i.e. what the result would be and what happens if the result is used since the code assumed if string conversion didn't bail it returned some useful string. I think this was the main reason we didn't allow exceptions in __toString() - it's hard to handle them properly. -- Stas Malyshev smalyshev@gmail.com