Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
class Task extends Threaded
public $response;
public function scraping()
$content = file_get_contents('');
preg_match('~<title>(.+)</title>~', $content, $matches);
$this->response = $matches[1];
$task = new Task;
$thread = new class($task) extends Thread {
private $task;
public function __construct(Threaded $task)
$this->task = $task;
public function run()
$thread->start() && $thread->join();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment