My friends and family are under attack in Ukraine.
Donate to protect them directly or help international organizations.
Donate to protect them directly or help international organizations.
Detect Compatibility Issues With phpco
PHPCompatibility detects compatibility issues between your code and a specific version of PHP, making it very useful for PHP upgrades.
If you already have Docker installed on your machine, you can run this tool more easily with phpco. You merely need to execute two console commands from your project's root:
phpco() { docker run --init -v $PWD:/mnt/src:cached --rm -u "$(id -u):$(id -g)" frbit/phpco:latest $@; return $?; }
phpco -p --colors --extensions=php,phtml --runtime-set testVersion 7.4 . --ignore="vendor/"
Customize the options to your liking.
--extensionsInclude all extensions of files that can contain PHP code. Here, I addedphtmlbecause Zend Framework 1 applications can contain a lot of PHP code in their phtml views.testVersionSet to the version to which you are upgrading.--ignoreAdd any folders that you don't want to scan. Should all libraries be excluded? It depends. This explanation can help you with the decision.
The phpco repository has more complete documentation.
