-3

当我试图在 php 7 中导出 excel 文件时,相同的代码在 php5 中工作

$worksheet =& new writeexcel_worksheet($name, $index, $this->_activesheet, $this->_firstsheet, $this->_url_format, $this->_parser, $this->_tempdir);

解析错误:语法错误,第 190 行 C:\xampp\htdocs\developer\wp-content\plugins\liveunited-payments\php_writeexcel\class.writeexcel_workbook.inc.php 中的意外“新”(T_NEW)

4

1 回答 1

0

php7 与 php5 不完全兼容,在大多数情况下你必须重构一些代码。

首先,尝试删除“新”附近的“&”

$worksheet =new writeexcel_worksheet($name, $index, $this->_activesheet,
                                  $this->_firstsheet,
                                  $this->_url_format, $this->_parser,
                                  $this->_tempdir);

我注意到某些外部库中会导致错误。最好的方法是将该供应商更新到支持 php7 的版本

于 2017-07-12T11:57:27.893 回答