Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96355 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 26047 invoked from network); 13 Oct 2016 21:38:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Oct 2016 21:38:32 -0000 Authentication-Results: pb1.pair.com smtp.mail=anatol.php@belski.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=anatol.php@belski.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain belski.net from 85.214.73.107 cause and error) X-PHP-List-Original-Sender: anatol.php@belski.net X-Host-Fingerprint: 85.214.73.107 klapt.com Received: from [85.214.73.107] ([85.214.73.107:45865] helo=h1123647.serverkompetenz.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 27/F6-41968-8DEFFF75 for ; Thu, 13 Oct 2016 17:38:32 -0400 Received: by h1123647.serverkompetenz.net (Postfix, from userid 1006) id 3CE427849D7; Thu, 13 Oct 2016 23:38:29 +0200 (CEST) Received: from w530phpdev (p54A7671F.dip0.t-ipconnect.de [84.167.103.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by h1123647.serverkompetenz.net (Postfix) with ESMTPSA id E63597849D4; Thu, 13 Oct 2016 23:38:26 +0200 (CEST) To: "'Nikita Popov'" Cc: "'Xinchen Hui'" , "'Davey Shafik'" , "'Derick Rethans'" , "'PHP Developers Mailing List'" References: <010701d2218e$b2e12d60$18a38820$@belski.net> <002001d22223$23363300$69a29900$@belski.net> In-Reply-To: Date: Thu, 13 Oct 2016 23:38:22 +0200 Message-ID: <025201d2259a$21e542f0$65afc8d0$@belski.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQItOLydTqT+dIGA3YBv5mmFOlapewMWylwtAqhC8kICT73digIfoWNeAggouZUCTaNu1598LkHA Content-Language: en-us Subject: RE: [PHP-DEV] Regression between RC1 and RC2? From: anatol.php@belski.net ("Anatol Belski") Hi Nikita, > So the problem basically is that in PHP 7.0 both print_r and var_dump = directly > print to output. This means that by the time the exception is thrown, = we've > already written output. This makes it unclear how exactly the = exception should > be handled. Is it okay to just print everything and handle the = exception > afterward? This seems odd to me -- if an operation fails it shouldn't = do anything. >=20 > In PHP 7.1 I've rewritten print_r() to use an internal buffer, so we = could handle > this case completely gracefully. The same change could be implemented = for > var_dump(). With this approach we'd only print anything if no = exception > occurred. >=20 How it sounds, there were two different ways to solve this in 7.0 and = 7.1? As 7.0 has limitations, IMHO it's fine to go by Hui's suggestion = fatal+exception text. It could be also ok to leave the state as it was = before 2d8ab515 in 7.0, so either way. But for 7.1, as it's possible to = get rid of the fatal in favor of catchable exception, probably it'd be = the right way to go. Is that what you suggest? I had no chance to look into your print_r changes yet. Could it be = possibly backported into 7.0, so both could go by same solution? Thanks Anatol