Ubuntu 管理心得

搜尋此網誌

2021年11月25日 星期四

Unexpected 'new' (T_NEW) in /usr/share/php/Spreadsheet/Excel/Writer/Workbook.php

cf: https://stackoverflow.com/questions/45057005/when-i-am-trying-to-export-excel-file-in-php-7-same-code-is-working-in-php5

Because Error msg:
Parse error: syntax error, unexpected 'new' (T_NEW) in /usr/share/php/Spreadsheet/Excel/Writer/Workbook.php on line 180

Edit the line 180 as:

#        $this->_parser           =& new Spreadsheet_Excel_Writer_Parser($this->_byte_order, $this->_BIFF_version);
        $this->_parser           =new Spreadsheet_Excel_Writer_Parser($this->_byte_order, $this->_BIFF_version);

And line 194 as:

#        $this->_tmp_format       =& new Spreadsheet_Excel_Writer_Format($this->_BIFF_version);
        $this->_tmp_format       =new Spreadsheet_Excel_Writer_Format($this->_BIFF_version);
 

沒有留言:

張貼留言

網誌存檔