Magento2: zend-code/src/Reflection/DocBlock/Tag/VarTag.php is 7.1 only

Created on 9 Oct 2017  路  7Comments  路  Source: magento/magento2

Preconditions

  1. PHP 7.0 or less
  2. Tested on Magento 2.3.0-dev
  3. any webserver & any browser

Steps to reproduce

  1. Add a product
  2. Select second store view
  3. set description for second store

Expected result

  1. Magento should not return Error 500
  2. Magento should warn user if he is using unsupported PHP in admin area

Actual result

  1. [08-Oct-2017 21:32:14 UTC] PHP Parse error: syntax error, unexpected '?' in vendor/zendframework/zend-code/src/Reflection/DocBlock/Tag/VarTag.php on line 69
    is causing Error 500 page
  2. Either drop support for php 7.0 or do not use this zend extension..
  3. If PHP 7.1 is required, there should be some warning in admin area that the store is running on old PHP
  4. note that zend-code requires PHP 7.1: https://github.com/zendframework/zend-code/blob/master/composer.json
  5. Perhaps, the dev should run always on latest PHP version?
Format is valid non-issue

Most helpful comment

hello guys,

the problem is the question mark before string type declaration.

selezione_080

All 7 comments

Did you run composer update under PHP 7.1 maybe? Seems to be a duplicate of https://github.com/magento/magento2/issues/11264.

yes, exactly.. my server have PHP5.6, PHP7.0, and PHP7.1 using PHP-FPM.. the CLI is under 7.1, so the issue is that it has installed 7.1 composer package, and under PHP-FPM i did switch for http to 7.1 but not for https version.. therefore i got to unstable state where it used the 7.1 zend package..

however i believe, you should add a warning to the admin area that the php version is obsolete and magento is in unstable state because someone else may run into this issue and blank screen is NOT good..

add a warning to the admin area that the php version is obsolete

PHP 7.0 is not obsolete. PHP version used for composer update is not kept anywhere as far as I know. The only problem here is that Magento needs to be deployed properly and Composer does his job pretty well on this.

@orlangur "PHP 7.0 is not obsolete" . As of today, it will be in 23 days. As of when you posted, it was 44 days until being obsolete. http://php.net/supported-versions.php

Active support ends December 3rd, 2017.
Security support ends December 3rd, 2018

Ironically, PHP 5.6 will continue to be actively supported for the next 9 months.

hello guys,

the problem is the question mark before string type declaration.

selezione_080

sure.. everybody knows that.. the issue occurs, only if you run composer with 7.1 and run php 7.0 on server side.. orlangur believes that magento should return white screen of death because your eshop is not configured properly. actually i dont agree with him, and magento should notify user that unexpected error may occur on frontend/backend, but i have gave up on discussion with narrowminded person

@gamort I raised this question among maintainers, as "Security support ends December 3rd, 2018" it is too early to drop PHP 7.0 support yet and especially it is not a good idea within 2.2.x line (basically, this issue is caused by similar decision in Zend_Code patch release, now people who don't use Composer properly may face with troubles due to 7.0/7.1 differences). I'm almost certain 2.3.0 will drop PHP 7.0 support.

@scholtz I'm kindly ask you to stop posting offensive comments.

Was this page helpful?
0 / 5 - 0 ratings