我正在尝试将此API密钥添加到Curl类。
$this->apiValue
我已经尝试过这些例子并试图尝试但我没有成功。
我收到内部500错误。可能是什么问题?
代码:
class APIkey
{
public $apiValue;
public function __construct(string $apiValue)
{
$this->apiValue = $apiValue;
}
public function getApiAna()
{
echo $this->apiValue;
}
}
结果:
内部500错误
答案 0 :(得分:0)
您正在尝试实现继承但未按预期使用。 同时将非静态方法称为静态 使用方式如下:
$c = new Curl('8fbb80d7f378f2276246388093439422');
$c->lists($json, $http_status);