A set of sniffs for PHP_CodeSniffer that checks for PHP version compatibility.

(standards, compatibility, phpcs)

Critical or Security advisories for 8.0.1

This version doesn't have any advisory. Want to report one?

Changelog for 8.0.1

See all related issues and PRs in the 8.0.1 milestone.


  • :star2: New DeprecatedTypeCasts sniff to detect deprecated and removed type casts, such as the (unset) type cast as deprecated in PHP 7.2. #498
  • :star2: New NewTypeCasts sniff to detect type casts not present in older PHP versions such as the (binary) type cast as added in PHP 5.2.1. #497
  • :star: NewGroupUseDeclaration: Detection of PHP 7.2 trailing comma's in group use statements. #504
  • :star: DeprecatedFunctions sniff: recognize some more PHP 7.2 deprecated functions. #501
  • :star: DeprecatedIniDirectives sniff: recognize more PHP 7.2 deprecated ini directives. #500
  • :star: ForbiddenNames sniff: recognize object as a forbidden keyword since PHP 7.2. #499
  • :star: NewReturnTypeDeclarations sniff: recognize generic parent, PHP 7.1 iterable and PHP 7.2 object return type declarations. #505, #499
  • :star: NewScalarTypeDeclarations sniff: recognize PHP 7.2 object type declarion. #499


:pencil2: Improved clarity of the deprecated functions alternative in the error message. #502


:fire_engine: Temporary hotfix for installed_paths (pending upstream fix.) #503


Thanks go out to [Juliette Reinders Folmer] for her contributions to this version. :clap:

Dependencies for 8.0.1

Name Requirement Status
^4.0 || ^5.0 || ^6.0

^2.2 || ^3.0.2

My projects using wimg/php-compatibility

Name Locked version Requirement
You should be logged in to see which of your projects use wimg/php-compatibility.