I want to use thread in PHP . I am using windows . What needs to be done to do this . Here is the code i am running .
<?php
class AsyncOperation extends Thread {
public function __construct($arg){
$this->arg = $arg;
}
public function run(){
if($this->arg){
printf("Hello %s\n", $this->arg);
}
}
}
$thread = new AsyncOperation("World");
if($thread->start())
$thread->join();
?>
When i run the code it shows
Fatal error: Class 'Thread' not found in D:\xampp\htdocs\my.php on line 2
Thanks in advance