Req->Doc #60243 [Opn->Asn]: Add way to specify output buffering chunk size of 1

From: Date: Fri, 11 Nov 2011 13:11:18 +0000
Subject: Req->Doc #60243 [Opn->Asn]: Add way to specify output buffering chunk size of 1
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-7414@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=60243&edit=1 ID: 60243 Updated by: aharvey@php.net Reported by: artificialmagic at hotmail dot com Summary: Add way to specify output buffering chunk size of 1 -Status: Open +Status: Assigned -Type: Feature/Change Request +Type: Documentation Problem -Package: Output Control +Package: Documentation problem PHP Version: 5.3.8 -Assigned To: +Assigned To: aharvey Block user comment: N Private report: N New Comment: This has actually been fixed in PHP 5.4 already as part of the output layer improvements: a chunk size of 1 now really means 1. I'll morph this into a documentation bug, because it's currently not noted in the manual or in the upgrade notes. Previous Comments: ------------------------------------------------------------------------ [2011-11-08 15:19:57] artificialmagic at hotmail dot com Here's a proper test script. This produces [4096][4096][4096][4096][4096]... ob_start(function($x) { return '[' . strlen($x) . ']'; }, 1); for (;;) echo '.'; So I'd like this to produce [1][1][1][1][1][1].... ob_start(function($x) { return '[' . strlen($x) . ']'; }, -1); for (;;) echo '.'; ------------------------------------------------------------------------ [2011-11-08 15:16:14] artificialmagic at hotmail dot com Description: ------------ ob_implicit_flush does not do anything in CLI. This script never produces output: ob_start(); ob_implicit_flush(true); for (;;) echo '.'; A 1-byte buffer would work around it, except that specifying a chunk_size of 1 to ob_start is taken to mean 4 kilobytes. As a workaround, please make a chunk_size of -1 to ob_start a synonym for a real 1, so that output buffering can be used for filtering or for redirection without actual delay in output. Currently the smallest size that can be specified is 2 bytes, which can cause a potentially infinite wait for an extra byte. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=60243&edit=1

« previous php.doc.bugs (#7414) next »