Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76979 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74225 invoked from network); 31 Aug 2014 04:48:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Aug 2014 04:48:04 -0000 Authentication-Results: pb1.pair.com header.from=tjerk.meesters@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=tjerk.meesters@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.180 as permitted sender) X-PHP-List-Original-Sender: tjerk.meesters@gmail.com X-Host-Fingerprint: 209.85.192.180 mail-pd0-f180.google.com Received: from [209.85.192.180] ([209.85.192.180:44594] helo=mail-pd0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A5/23-50403-209A2045 for ; Sun, 31 Aug 2014 00:48:03 -0400 Received: by mail-pd0-f180.google.com with SMTP id p10so3377071pdj.11 for ; Sat, 30 Aug 2014 21:47:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=TgeCBWbG2VXl0oPUwoarIJH1hpVW/Q+8XUF6Fia0Rxg=; b=pOsz/eIHDXrhWN9YUbBSwpDDOYX1I4ULow5gaVlXIRzY1drLB6QOp6L2bJblQhkn6Z 9DGTePyhsXldoK3XvUAjY8JlEByCQOXJzUti7YVgKw8LtGbccz6T6yD6391evFJhPyVz YN+QwLf9+Gi7xuoX2JoW5DQEBt2hBXBY1sOOt1WBvl5Ew7+3dXpiTC4GbMZsh/ttWQuK m9TTmSy3rXxVATsvj9HgAnVXh2m+pWwZeSS0lqvIrZ1quNEatIKEwM6vsUdmucUGaI+n djlCzgd8o5AYjTyY9bLRRxzXq0hncjGwt4kmj5MWM5VWCejjQMD72UWPqOBbQAoG6R9T GDkw== X-Received: by 10.66.102.37 with SMTP id fl5mr28372096pab.35.1409460479667; Sat, 30 Aug 2014 21:47:59 -0700 (PDT) Received: from [192.168.1.102] (bb121-7-198-24.singnet.com.sg. [121.7.198.24]) by mx.google.com with ESMTPSA id h12sm6417273pdk.48.2014.08.30.21.47.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 30 Aug 2014 21:47:58 -0700 (PDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) In-Reply-To: <5402A72B.5090805@sugarcrm.com> Date: Sun, 31 Aug 2014 12:47:54 +0800 Cc: PHP Internals , jocelyn fournier , Dmitry Stogov Content-Transfer-Encoding: quoted-printable Message-ID: References: <54027B6D.7060708@sugarcrm.com> <5402A72B.5090805@sugarcrm.com> To: Stanislav Malyshev X-Mailer: Apple Mail (2.1878.6) Subject: Re: [PHP-DEV] destructors and output_buffering From: tjerk.meesters@gmail.com (Tjerk Meesters) On 31 Aug, 2014, at 12:40 pm, Stas Malyshev = wrote: > Hi! >=20 >> This is just a thought; could we delay the call to >> `zend_call_destructors` ONLY IF there=92s output buffering taking = place >> (i.e. ob_get_level() > 0)? >=20 > That wouldn't help - imagine this: > 1. ob_start is set > 2. shutdown is starting > 3. ob functions shut down, call function foo > 4. function foo creates an object of class FooBar > 5. ob shutdown ends, all output is flushed, etc. > 6. FooBar::__destruct is run and tries to output something So let it output something ... Trying to output something in a destructor after flushing the output = seems rather fishy; at the same time I=92m quite aware that it=92s = impossible to predict what some developers would expect to happen in = such cases. >=20 > That scenario still may have a problem. I'll check more into if it's > really a big deal outputting after OB shutdown (after all, some other > things may lead to it too) but conditioning dtor move does not solve > this problem. If it works this way we may as well move them there > permanently. Yeah, I can see now how my suggestion doesn=92t really need the = condition then :) > --=20 > Stanislav Malyshev, Software Architect > SugarCRM: http://www.sugarcrm.com/