Переменная объекта теряет контекст в PHP-потоках
Я работал с pthreads в PHP и заметил, что pthreads теряет объектные переменные в своем контексте, это нормально или ошибка, или я делаю что-то не так?
class Downloader extends Thread {
private $ch;
public function __construct($data) {
$this->ch = curl_init();
}
public function __destruct() {
curl_close($this->ch);
}
public function run() {
// we just lost resource of curl -> [resource(4) of type (Unknown)]
curl_setopt($this->ch, CURLOPT_URL, $this->url);
}
}