• PHP Video Tutorials

PHP - Thread::getCreatorId() Function



Thread::getCreatorId - Identification

Syntax

public integer Thread::getCreatorId( void )

Thread::getCreatorId() function can return an identity of Thread that created a referenced Thread.

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

Example

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