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();
This gives me the error: Warning: in_array() expects parameter 2 to be array, null given in twilio-php-master\Services\Twilio.php on line 59. So at $this->client I am giving it an array. And when I use the new services_twilio class outside of the thread it works just fine.
What am I doing wrong.