lochmueller / staticfilecache

🚀 Fastest TYPO3 Extension ever 🚀
https://packagist.org/packages/lochmueller/staticfilecache
GNU General Public License v3.0
115 stars 65 forks source link

Parse Error: Classes/Service/CookieService.php #400

Closed maslme closed 1 year ago

maslme commented 1 year ago

Bug Report

Current Behavior Frontend crashed with a 503 error -> ParseError syntax error, unexpected 'private' (T_PRIVATE), expecting variable (T_VARIABLE)

in [...]/staticfilecache/Classes/Service/CookieService.php line 22

Expected behavior/output No Error ;-)

Environment

lochmueller commented 1 year ago

Hey @maslme the affected line ( https://github.com/lochmueller/staticfilecache/blob/13.1.3/Classes/Service/CookieService.php#L22 ) use constructor promotion https://wiki.php.net/rfc/constructor_promotion / https://php.watch/versions/8.0/constructor-property-promotion that is available since PHP 8.0. Are you really sure, that you execute the script with PHP 8.0.x? The error message sounds like, that class constructor promotion is not allowed/possible?!?! Regards, Tim

maslme commented 1 year ago

Thanks @lochmueller for your quick reply. Yes, you're right - upon closer inspection, I found that the error only occurs when I access the site through an alternative domain (which was still running on PHP 7.4), while on the main domain running PHP 8.0.30, everything worked fine.