旧版本:
PHP Version 5.3
新版本:
PHP Version 7.0.4
在此代码中:
$this->wsdl = & new wsdl('', $this->proxyhost, $this->proxyport, $this->proxyusername, $this->proxypassword, $this->timeout, $this->response_timeout, $this->curl_options, $this->use_curl);
现在,当我在新版本中托管相同的PHP Web应用程序时,我面临以下错误:
Parse error: syntax error, unexpected 'new' (T_NEW) in
D:\xampp\htdocs\website\libs\nusoap.php on line 7385
据我所知,这是因为PHP版本的变化。
请分享您的经验。 提前谢谢。
答案 0 :(得分:2)
只需移除&
,您的代码应该是:
$this->wsdl = new wsdl('', $this->proxyhost, $this->proxyport,
$this->proxyusername, $this->proxypassword,
$this->timeout, $this->response_timeout,
$this->curl_options, $this->use_curl);
As per the changes in PHP 7。无法通过引用分配新对象。