Phpspreadsheet: A PHP Error was encountered

Created on 19 Aug 2019  路  15Comments  路  Source: PHPOffice/PhpSpreadsheet

Parse error: syntax error, unexpected '=' in /srv/users/gwx-admin-all-service-user/apps/gwxwebapp/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php on line 1355
A PHP Error was encountered
Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /srv/users/gwx-admin-all-service-user/apps/gwxwebapp/public/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php:1355)

Filename: core/Common.php

Line Number: 570

Backtrace:

A PHP Error was encountered
Severity: Parsing Error

Message: syntax error, unexpected '='

Filename: Reader/Xlsx.php

Line Number: 1355

Backtrace:

All 15 comments

Isn't this because version 1.9 now requires at least PHP 7.1?
I encountered the same problem, and now use version 1.8.2 because upgrading PHP from 7.0 to 7.1+ is not an option at the moment.
In my honest opinion version 1.9 had to be 2.0, because now requiring PHP 7.1+ is a breaking change and not a minor update....

I got the same error, unexpected '=', www/test/bd_xqb_php/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xls.php:1092

my server's PHP version is 7.3 , my local computer php version is 7.2, and it works well in my local. I changed my local PHP version to 7.3, and got no error.

I don't know how to fix it, do you have any solutions?

I got the same issue.

Local development = PHP 7.1 and PHPSpreadsheet is 1.9 => Works well
Server = PHP 7.2 => Gives error

PHP Parse error: syntax error, unexpected '=' in /vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php on line 1355

I'm getting the same error on PHP 7.3.9, but for a different PhpSpreadsheet file:
Parse error: syntax error, unexpected '=' in D:\htdocs\vendor\phpoffice\phpspreadsheet\src\PhpSpreadsheet\Calculation\Calculation.php on line 2460

Keeping my PHP version on 7.3 but reverting back to PhpSpreadsheet to 1.8.2 gets me working again for now.

Type: ParseError

Message: syntax error, unexpected '='

Filename: /var/www/html/simrs/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php

Line Number: 1355

I got the same issue ->development = PHP 7.1 and PHPSpreadsheet is 1.9

This error is caused by your PHP version.
use PHP version 7.1 or newer to develop using PhpSpreadsheet.
so check your PHP version and make sure its 7.1 above

Got error 'PHP message: PHP Parse error: syntax error, unexpected '=' in /var/www/html/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php on line 1355n'

Works on XAMPP with PHP version 7.2
I get this error on Ubuntu 16 with PHP version 7.3

This error is caused by your PHP version.
use PHP version 7.1 or newer to develop using PhpSpreadsheet.
so check your PHP version and make sure its 7.1 above
i was tray to update my php to 7.2 and 7.3 and im still have an error ini installation phpspreedsheet. i use ubuntu 16

my php version is 7.0 and phpspreadsheet version is 1.9,i got the same error.
so i downgrade the phpspreadsheet 1.8 . it's works fine

same problem
php 7.3

downgrade to 1.8 solved the bug

how to downgrade spreedsheet ? thxs

You can find all versions in the releases section:
https://github.com/PHPOffice/PhpSpreadsheet/releases

But PHP 7.2, 7.3 and 7.4 should work.
If not, install the very latest release and report the exact problem. Reader/Xlsx.php on line 1355 is comment in 1.10.1

I received same unexpected "=" error at PhpSpreadsheet/Reader/Xlsx.php on line 1332. Using 1.11.0. No error on PHP 7.2.10. I get the error on 7.3.6.

Got me the same error on version 1.12, PHP 7.0.33 NTS. Downgraded to 1.8.0, worked like a charm.

Works well on Laragon Local PHP 7.0.33 and 7.2.19.

Exception: syntax error, unexpected '=' /var/www/html/form/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Calculation.php 2495

PHP 7.4.6, syntax error, unexpected '='

in Calculation.php line 2460

at Application->handleShutdown()
in RegistersExceptionHandlers.php line 54

Was this page helpful?
0 / 5 - 0 ratings

Related issues

garnold picture garnold  路  5Comments

PowerKiKi picture PowerKiKi  路  5Comments

sadlyblue picture sadlyblue  路  3Comments

Blacknife picture Blacknife  路  4Comments

isopen picture isopen  路  3Comments