note 117724 added to function.ob-start

From: Date: Tue, 28 Jul 2015 17:27:05 +0000
Subject: note 117724 added to function.ob-start
Groups: php.notes 
Request: Send a blank email to php-notes+get-203210@lists.php.net to get a copy of this message
This concerns the default values used for ob_start(). Note that I could verify that ob_start() and ob_start(null,0) are not always equivalent. It seems that with ob_start() the output buffer is open with current default parameters of your configuration if they have been explicitly defined. So, if you have set $chunk_size to any value previously and send data larger than $chunk_size the data will be automatically flushed by blocks of $chunk_size. If you explicitely define $chunk_size=0, later, when you will use any function as $my_ob_dataoutput=ob_get_clean(); you will get back the whole content of your output (quite unlimited with $chunk_size=0). I discover this because my var $my_ob_dataoutput was truncated. Using "ob_get_status (true)" function, I could verify that an error (in a lower level or by default out of my control) was setting previously the $chunk_size of ob at 4096. I changed "ob_start()" for "ob_start(null,0)" and everything became OK. ---- Server IP: 72.52.91.14 Probable Submitter: 90.24.127.235 ---- Manual Page -- http://php.net/manual/en/function.ob-start.php Edit -- https://master.php.net/note/edit/117724 Del: integrated -- https://master.php.net/note/delete/117724/integrated Del: useless -- https://master.php.net/note/delete/117724/useless Del: bad code -- https://master.php.net/note/delete/117724/bad+code Del: spam -- https://master.php.net/note/delete/117724/spam Del: non-english -- https://master.php.net/note/delete/117724/non-english Del: in docs -- https://master.php.net/note/delete/117724/in+docs Del: other reasons-- https://master.php.net/note/delete/117724 Reject -- https://master.php.net/note/reject/117724 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#203210) next »