Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:64062 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18386 invoked from network); 27 Nov 2012 09:11:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Nov 2012 09:11:15 -0000 Authentication-Results: pb1.pair.com smtp.mail=mike.php.net@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=mike.php.net@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.170 as permitted sender) X-PHP-List-Original-Sender: mike.php.net@gmail.com X-Host-Fingerprint: 209.85.223.170 mail-ie0-f170.google.com Received: from [209.85.223.170] ([209.85.223.170:63293] helo=mail-ie0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 18/76-11726-1B384B05 for ; Tue, 27 Nov 2012 04:11:13 -0500 Received: by mail-ie0-f170.google.com with SMTP id k10so9916658iea.29 for ; Tue, 27 Nov 2012 01:11:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=CFKj206tkEGPiERztx/34lXD+sfbC/A3xxGHHlygwkY=; b=0L5FDNzdJ3yQ+Fk4Mu8AH2x5ICKBEfFXNCKSRlFsdgsehLpERqknIwyph3JbW9L5/L DAGOw4EH8+hlmg+tk6LRhelRyLoOa20TYQHURVU3X/2aRETtMOBXqVtIoQX8YQdTADVk FnaWh5Sw6NmNVVC9gHqLVkvnKoiS1hNWhtS2nChSF5Q5ONawSsh+ShZOjkYmFMY3rFTB w9bSMV23/rqr1lWgU249aqNAWj9PqIV+RHQ5jwwrBur7LBfyKWn2WuWX7EGy1ZrfpXiO tVYZQCiwtpIpYPHKICipMz6CfIilTxcYft5TDzL3AcNwt+j78D8G6EzBC+xeAvUYS0IF EocQ== MIME-Version: 1.0 Received: by 10.50.178.67 with SMTP id cw3mr17267598igc.53.1354007471174; Tue, 27 Nov 2012 01:11:11 -0800 (PST) Sender: mike.php.net@gmail.com Received: by 10.231.83.202 with HTTP; Tue, 27 Nov 2012 01:11:10 -0800 (PST) In-Reply-To: <50B380AC.9000901@php.net> References: <50B1F9D7.80000@php.net> <50B380AC.9000901@php.net> Date: Tue, 27 Nov 2012 10:11:10 +0100 X-Google-Sender-Auth: YrSwN1Pi6gDTMizKMydjbfdBWTA Message-ID: To: Casper Langemeijer Cc: internals@lists.php.net Content-Type: text/plain; charset=UTF-8 Subject: Re: Bug 61272 From: mike@php.net (Michael Wallner) On 26 November 2012 15:46, Casper Langemeijer wrote: > Hmm.. I suppose It's up to me to make a strong (if possible watertight) plea > for the old way. I will try: > > 1. I don't think my patch impacts the efficiency of php_output_clean(). It > adds a single if with a binary compare. True: this causes output to get > piped through the output handler, but the output handler callback function > could be smart enough to back off when the PHP_OUTPUT_HANDLER_CLEAN bit is > set in the second parameter of the callback. > > 2. Current behaviour is *not* according the documentation. ob_start() > documentation states: " An optional output_callback function may be > specified. This function takes a string as a parameter and should return a > string. The function will be called when the output buffer is flushed (sent) > or **cleaned** (with ob_flush(), ob_clean() or similar function) or when the > output buffer is flushed to the browser at the end of the request. When > output_callback is called, it will receive the contents of the output buffer > as its parameter and is expected to return a new output buffer as a result, > which will be sent to the browser." (*-emphasis mine) Which emphasizes the fact, that implementation and documentation differed quite a bit. The ob_clean note was obviously added in 2008 [1] [2], when the new output code was sleeping in the PHP6 branch. > > Current behaviour differs: > On calling ob_end_clean() or ob_clean(), output_callback is called, but > *without* the contents of the output buffer as its parameter. > > 3. Implementing my patch will never break anything. The output will be > passed to the callback, but anything returned by it *will* be discarded. > > 4. If you are not going to pass the contents of the output buffer on > ob_end_clean() or ob_clean() to the callback function, Why would you call > the callback anyway? I guess I got your argument now :) I'll have a look. Thanks for spending your time to make PHP better. [1] http://svn.php.net/viewvc/phpdoc/en/trunk/reference/outcontrol/functions/ob-start.xml?r1=246628&r2=268496 [2] https://bugs.php.net/bug.php?id=44150 -- Regards, Mike