Objektvariable verliert in PHP-pthreads den Kontext
Ich habe mit pthreads in PHP gearbeitet und festgestellt, dass pthreads Objektvariablen in seinem Kontext verliert. Ist das normal oder ein Fehler oder mache ich etwas falsch?
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);
}
}