• PHP Video Tutorials

PHP - Thread::getThreadId() Function



Thread::getThreadId - Identification

Syntax

public integer Thread::getThreadId( void )

Thread::getThreadId() function can return an identity of referenced Thread.

Thread::getThreadId() function doesn't have any parameters and can return a numeric identity.

Example

<?php
   class My extends Thread {
      public function run() {
         printf("%s is Thread #%lu\n", __CLASS__, $this->getThreadId());
      }
   }
   $my = new My();
   $my->start();
?>
php_function_reference.htm
Advertisements