เมื่อฉันใช้ twilio ฉันได้รับข้อผิดพลาดดังต่อไปนี้:
ข้อผิดพลาดร้ายแรงที่ตรวจจับได้ของ PHP: อาร์กิวเมนต์ 2 ส่งผ่านไปยัง Twilio\Rest\Api\V2010\Account\MessageInstance::__construct() ต้องเป็นประเภทอาร์เรย์ ให้ค่า null เรียกใน /data/home/changliang /twilio/twilio-php-master/Twilio/Rest/Api/V2010/Account/MessageList.php ออนไลน์ 69 และกำหนดไว้ใน /data/home/changliang/twilio/twilio-php-master/Twilio/Rest/Api/V2010 /Account/MessageInstance.php ที่บรรทัด 52
นี่คือรหัสของฉัน
require_once("/twilio/twilio-php-master/Twilio/autoload.php");
use Twilio\Rest\Client;
$to = '+12022022022'
$content = 'hello';
$sid = 'XXXXXXX';
$token = 'XXXXXXXX';
$client = new Client($sid, $token);
$sms = $client->account->messages->create(
$to,
array(
'from' => '+12346788xx',
'body' => $content,
)
);