I was working with pthreads in PHP and noticed that pthreads loses object variables in its context, is this normal or a bug or I'm doing something wrong ?
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);
}
}