PHP - Fonction Thread :: getCurrentThread ()

Thread :: getCurrentThread - Identification

Syntaxe

public static Thread Thread::getCurrentThread ( void )

La fonction Thread :: getCurrentThread () peut renvoyer une référence à Thread en cours d'exécution.

La fonction Thread :: getCurrentThread () n'a aucun paramètre et peut renvoyer un objet représentant Thread en cours d'exécution.

Exemple

<?php
   class My extends Thread {
      public function run() {
         var_dump(Thread::getCurrentThread());
      }
   }
   $my = new My();
   $my->start();
?>