PHP - Fonction Thread :: getCurrentThreadId ()

Thread :: getCurrentThreadId - Identification

Syntaxe

public static integer Thread::getCurrentThreadId( void )

La fonction Thread :: getCurrentThreadId () peut retourner l'identité du Thread en cours d'exécution.

La fonction Thread :: getCurrentThreadId () n'a aucun paramètre et peut renvoyer une identité numérique.

Exemple

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