1

We are upgrading from php 7 to php 8 on our backend. There is a smoke-test automation in place to verify the expected functionaly.

I am thinking if it is feasible to read our php code base and look for deprecated and imcompatible features from php 8 release notes with automated script https://www.php.net/manual/en/migration80.incompatible.php https://www.php.net/manual/en/migration80.deprecated.php if there is a match in our code base, then it is likely to be an issue.

2 Answers 2

3

Scanning for deprecated and incompatible features is a good starting point. Your smoke test automation should catch any critical functionality that's broken.

From there, you may or may not experience more subtle problems with the upgrade: it just depends on precisely what subset of the language you use and what changes have been made.

My recommendation is to be particularly vigilant for a few months after the upgrade, and be prepared for extra bugs to emerge. As an example, we recently upgraded our databases, and found an issue in the order in which the database evaluated nested function calls. Technically, this was a correction from the database provider, but it wasn't something we'd expected or come across during testing. Fortunately, it's a simple fix.

1
  • yeah, should reserve extra points for a few sprints in case upgrade goes wrong
    – Yu Zhang
    Commented Apr 14, 2023 at 21:57
1

Yes, some kind of linter / static code analysis tool which checks for deprecated functions should yield some results.

See http://wapmorgan.github.io/PhpDeprecationDetector/

PhpDeprecationDetector detects:

  • Usage of deprecated functions, variables, constants and ini-directives.
  • Usage of deprecated functions functionality.
  • Usage of forbidden names or tricks (e.g. reserved identifiers in newer versions).
1
  • thanks, I did not know anything about this tool. Much appreciated
    – Yu Zhang
    Commented Apr 15, 2023 at 2:12

Your Answer

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

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