Zmienna obiektowa traci kontekst w pthreads PHP
Pracowałem z pthreads w PHP i zauważyłem, że pthreads traci zmienne obiektowe w swoim kontekście, czy to normalne, czy błąd, czy robię coś nie tak?
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);
}
}