• PHP Video Tutorials

PHP - Thread::kill() Function



Thread::kill - Execution

Syntax

public void Thread::kill(void)

Thread::kill() function can force a referenced Thread to terminate.

Thread::kill() function doesn't have any parameters and can return a boolean indication of success.

Example

<?php
   class T extends Thread {
      public function run() {
         $stdin = fopen("php://stdin", "r");
         while(($line = fgets($stdin))) {
            echo $line;
         }
      }
   }
   $t = new T();
   $t->start();

   var_dump($t->kill());
?>
php_function_reference.htm
Advertisements