Uploaded image for project: 'translate5'
  1. translate5
  2. TRANSLATE-702

Migrate translate5 to be using PHP 7.3

    XMLWordPrintable

Details

    • Task
    • Resolution: Done
    • translate5 - 3.2.0
    • None
    • None

    Description

      Zugesagte Umsetzung bis Mitte Februar

      According to the PHP Manual we have to do the following things to enable translate5 for PHP 7:

      • check usage of set_exception_handlers when a Error is thrown (not existing in translate5 code, only in Zend)
      • find indirect variable access usage, since evaluation order changes, the affected expressions can be grepped for, see the corresponding section in the php change log
      • check list() usage
      • grep in the code for hexadecimal numbers as string, since they are not considered as numeric any more
      • grep for the as removed marked methods
      • check in ini files for # comments, they are not possible any more (use ; instead)
      • ensure that our previously implemented own type declarations for int / bool / string etc are valid. For example our "integer" must be converted to int. See list in http://php.net/manual/en/functions.arguments.php#functions.arguments.type-declaration
      • Zend: we should switch to Zend 1.12.12, see Zend Docu ZF1.12.20 our own fork of ZF1: https://github.com/MittagQI/zf1-php7.3
      • ThirdParty: check for updates (see https://jira.translate5.net/browse/TRANSLATE-1593 )

      See if this causes problems somewhere and handle it then:

      • JSON: json_decode ends up in an JSON error if the given string is an empty string. Evaluate all places and avoid empty strings or pretend then the json_decode call. Found out in using the tests on a PHP7 installation.
      • foreach usages:
        • at least the new behaviour that foreach iterates over a copy in default by-value mode will lead to errors!
        • the self changing foreach in on reference mode can be problem in our different parsers in the project

      The following changes could affect us too:

      • Since many (fatal) errors are converted to exceptions, it is possible that the error based checkmode on import could not work any more. This must be tested.
      • mssql is removed in favour of the sqlsrv extension

      New Features:

      • parameter and return type declarations, which we should use in future. Some Details has to be discussed / researched before:
        • is default = null working for parameters (also null directly). Not all places can just be converted, since sometimes we expect mixed values, same for return values.
      • Anonymous classes
      • arrays as const / define
      • Null coalescing operator
      • spaceship operator
      • preg_replace_callback_array
      • ... Operator (already in PHP 5.6)

      Other problems / todos resulting on the PHP7 update:
      Since for TRANSLATE-1421 most parts of the application has to be tested manually, TRANSLATE-1421 should be implemented along with the PHP7 update.

      Also this task includes to switch the usage of PHPExcel to PHPSpreadsheet (the successor of PHPExcel) since PHPExcel does not support PHP7.1

      For Zend Framework 1: To me it is currently unclear, if it still runs under PHP 7.2 without errors. See these threads:

      Also there are forks with the goal to further support ZF 1 with new PHP versions:

       

      Attachments

        Issue Links

          Activity

            People

              Ines-Paul Ines-Paul Baumann (Inactive)
              tlauria Thomas Lauria
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: