<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.curl.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'function.curl-multi-select.php',
    1 => 'curl_multi_select',
    2 => 'Wait until reading or writing is possible for any cURL multi handle connection',
  ),
  'up' => 
  array (
    0 => 'ref.curl.php',
    1 => 'cURL Functions',
  ),
  'prev' => 
  array (
    0 => 'function.curl-multi-remove-handle.php',
    1 => 'curl_multi_remove_handle',
  ),
  'next' => 
  array (
    0 => 'function.curl-multi-setopt.php',
    1 => 'curl_multi_setopt',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/curl/functions/curl-multi-select.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.curl-multi-select" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">curl_multi_select</h1>
  <p class="verinfo">(PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">curl_multi_select</span> &mdash; <span class="dc-title">Wait until reading or writing is possible for any cURL multi handle connection</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.curl-multi-select-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>curl_multi_select</strong></span>(<span class="methodparam"><span class="type"><a href="class.curlmultihandle.php" class="type CurlMultiHandle">CurlMultiHandle</a></span> <code class="parameter">$multi_handle</code></span>, <span class="methodparam"><span class="type"><a href="language.types.float.php" class="type float">float</a></span> <code class="parameter">$timeout</code><span class="initializer"> = 1.0</span></span>): <span class="type"><a href="language.types.integer.php" class="type int">int</a></span></div>

  <p class="para rdfs-comment">
   Blocks the execution of the script until a cURL handle attached to
   the cURL multi handle would be able to make progress on the next call to
   <span class="function"><a href="function.curl-multi-exec.php" class="function">curl_multi_exec()</a></span> or until the timeout strikes
   (whichever comes first).
  </p>

 </div>


 <div class="refsect1 parameters" id="refsect1-function.curl-multi-select-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>
    <dt><code class="parameter">multi_handle</code>
</dt><dd><p class="para">A cURL multi handle returned by
<span class="function"><a href="function.curl-multi-init.php" class="function">curl_multi_init()</a></span>.</p></dd>
    
     <dt><code class="parameter">timeout</code></dt>
     <dd>
      <p class="para">
       Time, in seconds, to wait for a response from the active cURL multi handle connections.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.curl-multi-select-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   On success, returns the number of active descriptors contained in
   the descriptor sets. This may be <code class="literal">0</code> if there was no activity on any
   of the descriptors. On failure, this function will
   return <code class="literal">-1</code> on a select failure (from the
   underlying <code class="literal">select()</code> system call).
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-function.curl-multi-select-errors">
  <h3 class="title">Errors/Exceptions</h3>
  <p class="simpara">
   Throws a <span class="exceptionname"><a href="class.valueerror.php" class="exceptionname">ValueError</a></span> if <code class="parameter">timeout</code>
   is less than <code class="literal">0</code> 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.curl-multi-select-changelog">
  <h3 class="title">Changelog</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Version</th>
      <th>Description</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.4.0</td>
      <td>
       Now throws a <span class="exceptionname"><a href="class.valueerror.php" class="exceptionname">ValueError</a></span> if <code class="parameter">timeout</code>
       is less than <code class="literal">0</code> or greater than <strong><code><a href="reserved.constants.php#constant.php-int-max">PHP_INT_MAX</a></code></strong>.
      </td>
     </tr>

     <tr>
 <td>8.0.0</td>
 <td>
  <code class="parameter">multi_handle</code> expects a <span class="classname"><a href="class.curlmultihandle.php" class="classname">CurlMultiHandle</a></span>
  instance now; previously, a <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> was expected.
 </td>
</tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 seealso" id="refsect1-function.curl-multi-select-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.curl-multi-init.php" class="function" rel="rdfs-seeAlso">curl_multi_init()</a> - Returns a new cURL multi handle</span></li>
   </ul>
  </p>
 </div>


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