<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.stream.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'function.stream-set-chunk-size.php',
    1 => 'stream_set_chunk_size',
    2 => 'Set the stream chunk size',
  ),
  'up' => 
  array (
    0 => 'ref.stream.php',
    1 => 'Stream Functions',
  ),
  'prev' => 
  array (
    0 => 'function.stream-set-blocking.php',
    1 => 'stream_set_blocking',
  ),
  'next' => 
  array (
    0 => 'function.stream-set-read-buffer.php',
    1 => 'stream_set_read_buffer',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/stream/functions/stream-set-chunk-size.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.stream-set-chunk-size" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">stream_set_chunk_size</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.4.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">stream_set_chunk_size</span> &mdash; <span class="dc-title">Set the stream chunk size</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.stream-set-chunk-size-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>stream_set_chunk_size</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$stream</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$size</code></span>): <span class="type"><a href="language.types.integer.php" class="type int">int</a></span></div>

  <p class="para rdfs-comment">
   Set the stream chunk size.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.stream-set-chunk-size-parameters">
  <h3 class="title">Parameters</h3>
  <dl>
   
    <dt><code class="parameter">stream</code></dt>
    <dd>
     <p class="para">
      The target stream.
     </p>
    </dd>
   
   
    <dt><code class="parameter">size</code></dt>
    <dd>
     <p class="para">
      The desired new chunk size.
     </p>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.stream-set-chunk-size-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns the previous chunk size on success.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-function.stream-set-chunk-size-errors">
  <h3 class="title">Errors/Exceptions</h3>
  <p class="para">
   A <span class="classname"><a href="class.valueerror.php" class="classname">ValueError</a></span> is thrown if <code class="parameter">size</code>
   is less than 1 or greater than <strong><code><a href="reserved.constants.php#constant.php-int-max">PHP_INT_MAX</a></code></strong>.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.stream-set-chunk-size-changelog">
  <h3 class="title">Changelog</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>Version</th>
       <th>Description</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>8.0.0</td>
       <td>
        A <span class="classname"><a href="class.valueerror.php" class="classname">ValueError</a></span> is now thrown if
        <code class="parameter">size</code> is less than 1 or greater than
        <strong><code><a href="reserved.constants.php#constant.php-int-max">PHP_INT_MAX</a></code></strong>. Previously, an
        <strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong> level error was emitted and <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> was
        returned.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


</div><?php manual_footer($setup); ?>