Upgrade 4.5.19 -> 4.5.32 breaks

Hi there,

I attempted to upgrade a site running 4.5.19 to 4.5.32. The site is no longer working :frowning:

[2021-02-09 03:48:10] production.ERROR: Symfony\Component\Debug\Exception\FatalThrowableError [0] : /data/www//vendor/symfony/translation/Translator.php [Line 91] => Parse error: syntax error, unexpected ‘?’, expecting variable (T_VARIABLE)

Line 91 reads:

public function __construct(?string $locale, MessageFormatterInterface $formatter = null, string $cacheDir = null, bool $debug = false, array $cacheVary = [])

As far as I know ?string is not valid PHP so I’ve started fixing what I think is not correct. After replacing a couple of ?string with string, I am now stuck at:

[2021-02-09 04:05:16] production.ERROR: Symfony\Component\Debug\Exception\FatalThrowableError [0] : /data/www//vendor/doctrine/inflector/lib/Doctrine/Inflector/Language.php [Line 9] => Parse error: syntax error, unexpected ‘const’ (T_CONST), expecting variable (T_VARIABLE)

Line 9 is the line with “public const ENGLISH”, see below.

<?php declare(strict_types=1);<?php declare(strict_types=1); namespace Doctrine\Inflector; final class Language { public const ENGLISH = 'english'; namespace Doctrine\Inflector; final class Language { public const ENGLISH = 'english'; Any suggestions what is going on here? regards, Jan

Hi,

If you’re using PHP 7.0 try upgrading to PHP 7.1

Hi,

Thanks for the quick reply :slight_smile:

Upgrading to PHP 7.1 (not in the standard repo’s for Debian 9) might break other sites running on the same Debian 9 host so I’m a bit reluctant to do that. The host is scheduled to be upgraded to Debian 10 but by that time I might be wanting to look at v5.

Can I simply downgrade to 4.5.19 or are there other breaking (database) changes?

Jan

I don’t believe there are any database changes however the v5 migration requires the latest version to function correctly