To verify PHP version compatibility in your code, you can use PHP CodeSniffer with the PHPCompatibility ruleset. Ensure that the PHPCompatibility ruleset is installed before proceeding. For instance, on Arch Linux, you simply need to install the following two packages: php-codesniffer and php-codesniffer-phpcompatibility. Note that scanning a large codebase may require a significant amount of memory, so be prepared to allocate sufficient resources.
Source code viewer
# Specifiy the target PHP version (e.g., 5.6, 7.4, 8.0, 8.1, etc.) and replace path to your code. phpcs --standard=PHPCompatibility --runtime-set testVersion 7.4 path/to/your/codeProgramming Language: Bash