Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:44506 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85238 invoked from network); 27 Jun 2009 00:24:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Jun 2009 00:24:36 -0000 Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lerdorf.com from 209.85.146.183 cause and error) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.146.183 wa-out-1112.google.com Received: from [209.85.146.183] ([209.85.146.183:29726] helo=wa-out-1112.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5F/AE-08868-2C6654A4 for ; Fri, 26 Jun 2009 20:24:35 -0400 Received: by wa-out-1112.google.com with SMTP id m16so464690waf.7 for ; Fri, 26 Jun 2009 17:24:32 -0700 (PDT) Received: by 10.114.185.12 with SMTP id i12mr6708235waf.16.1246062272265; Fri, 26 Jun 2009 17:24:32 -0700 (PDT) Received: from ?192.168.200.148? (c-69-181-146-64.hsd1.ca.comcast.net [69.181.146.64]) by mx.google.com with ESMTPS id l37sm6910887waf.40.2009.06.26.17.24.30 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 26 Jun 2009 17:24:31 -0700 (PDT) Message-ID: <4A4566BD.4000109@lerdorf.com> Date: Fri, 26 Jun 2009 17:24:29 -0700 User-Agent: Thunderbird 2.0.0.18 (Macintosh/20081105) MIME-Version: 1.0 To: Ilia Alshanetsky CC: Scott MacVicar , Pierre Joye , Lukas Kahwe Smith , PHP internals References: <9A46F4B8-E64A-4C3C-B2A5-FC354A3EB71D@pooteeweet.org> <0C2F23C2-D188-4938-B44C-4ED166B934CE@macvicar.net> <4A451D6A.8090102@lerdorf.com> <4A454583.9000801@lerdorf.com> <901C4626-24FD-46A6-A116-7B9502FCD67D@prohost.org> In-Reply-To: X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] post 5.3.0 development From: rasmus@lerdorf.com (Rasmus Lerdorf) Just to keep the list in synch with the irc discussion. I pointed out that this is only half of the fix. The refcount still prevents fclose from flushing the data, so if you do: $url = 'http://slowgeek.com/test.xml'; $cfile = 'out.xml'; $ch = curl_init($url); curl_setopt($ch, CURLOPT_FILE, $fp = fopen($cfile,'w')); $status = curl_exec($ch); fclose($fp); $data = file_get_contents($cfile); var_dump($data); // 0 bytes here curl_close($ch); $data = file_get_contents($cfile); var_dump($data); // full contents here I still think we need to look at doing a flush on an fclose which doesn't reach the stream destructor due to refcount issues. Can anybody think of any side-effects of a flush on a stream close? -Rasmus