0
class testing extends Thread {
public $client;
public function __construct($persons) { // set passed arguments
$this->persons = $persons;
}
public function run() { // run thread
$this->client = new Services_Twilio('my_id', 'my_token');
printf('%s: %s' . "<br>", date("g:i:sa"), $this->client->account->sms_messages->create($this->persons[0], $this->persons[1], $this->persons[2])->sid);
}
}
$testing= new multipleSMS(['+XXXXXXXXXXXX', 'xxx-xxx-xxxx', 'A sample message']);
$testing->start();
这给了我错误:Warning: in_array() expects parameter 2 to be array, null given in twilio-php-master\Services\Twilio.php on line 59
。因此,在$this->client
我给它一个数组。当我使用新services_twilio类的线程之外它工作得很好。pthreads:调用线程内的阵列不工作
我在做什么错。
我会回答... –