I am trying to upgrade Magento version from 2.3.0 to 2.3.1 and I am using PHP 7.2 for same but while I run upgrade command getting bellow error is anyone have any idea how to fix?

   Parse error: syntax error, unexpected ':', expecting ';' or '{' in /vendor/magento/inventory-composer-installer/src/Plugin.php on line 55

    Warning: Unsupported declare 'strict_types' in /vendor/magento/inventory-composer-installer/src/Plugin.php on line 6

    Parse error: syntax error, unexpected ':', expecting ';' or '{' in /vendor/magento/inventory-composer-installer/src/Plugin.php on line 55

enter image description here

  • Magento 2.3.1 is compatible with 7.2.x only Apr 11, 2019 at 11:24
  • i also try to update at 7.2.x still also same error Apr 11, 2019 at 11:25
  • Magento 2.3.1 is compatible with PHP 7.2.x and one more thing have you checked your php version in command interface using php -v ? Apr 11, 2019 at 11:27
  • Can you please share your console screenshot? Apr 11, 2019 at 11:28
  • added, please check Apr 11, 2019 at 11:36

2 Answers 2


Magento does not require PHP 7.2 since 2.3.1 release, PHP 7.1.3 and later still supported. https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements-tech.html

in your case, the system has a fatal error encountering void return type https://github.com/magento-engcom/inventory-composer-installer/blob/master/src/Plugin.php#L55

Which is added since PHP 7.1 release - https://www.php.net/manual/en/migration71.new-features.php


it was due to a server issue, when I run composer update command it taking wrong PHP version due to some server configuration. so I just download composer.phar file for run composer update using PHP version and it worked. for me, bellow command working php composer.phar update

Magento 2.3.1 required php 7.1 version if version is less then php 7.1 then it give error in my case default php version was 5.6 something so it giving error

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.