<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Returns a unique identifier for the current thread</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.zend-logo-guid.html">zend_logo_guid</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.zend-version.html">zend_version</a></div> <div class="up"><a href="ref.info.html">PHP Options/Info Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="function.zend-thread-id" class="refentry"> <div class="refnamediv"> <h1 class="refname">zend_thread_id</h1> <p class="verinfo">(PHP 5)</p><p class="refpurpose"><span class="refname">zend_thread_id</span> — <span class="dc-title">Returns a unique identifier for the current thread</span></p> </div> <div class="refsect1 description" id="refsect1-function.zend-thread-id-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">int</span> <span class="methodname"><strong>zend_thread_id</strong></span> ( <span class="methodparam">void</span> )</div> <p class="para rdfs-comment"> This function returns a unique identifier for the current thread. </p> </div> <div class="refsect1 returnvalues" id="refsect1-function.zend-thread-id-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns the thread id as an integer. </p> </div> <div class="refsect1 examples" id="refsect1-function.zend-thread-id-examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example" id="example-525"> <p><strong>Example #1 <span class="function"><strong>zend_thread_id()</strong></span> example</strong></p> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"> <span style="color: #0000BB"><?php<br />$thread_id </span><span style="color: #007700">= </span><span style="color: #0000BB">zend_thread_id</span><span style="color: #007700">();<br /><br />echo </span><span style="color: #DD0000">'Current thread id is: ' </span><span style="color: #007700">. </span><span style="color: #0000BB">$thread_id</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?></span> </span> </code></div> </div> <div class="example-contents"><p>The above example will output something similar to:</p></div> <div class="example-contents screen"> <div class="cdata"><pre> Current thread id is: 7864 </pre></div> </div> </div> </p> </div> <div class="refsect1 notes" id="refsect1-function.zend-thread-id-notes"> <h3 class="title">Notes</h3> <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para"> This function is only available if PHP has been built with ZTS (Zend Thread Safety) support and debug mode (<em>--enable-debug</em>). </p> </p></blockquote> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.zend-logo-guid.html">zend_logo_guid</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.zend-version.html">zend_version</a></div> <div class="up"><a href="ref.info.html">PHP Options/Info Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>