Skip to content

Releases: PHPCompatibility/PHPCompatibility

10.0.0-alpha2 - 2025-11-28

28 Nov 11:41
Immutable release. Only release title and notes can be modified.
e0f0e5a

Choose a tag to compare

Pre-release

IMPORTANT: This release contains breaking changes. Please read and follow the Upgrade guide in the wiki carefully before upgrading!

This release includes all improvements and bugfixes from PHPCompatibility 10.0.0-alpha1.

See all related issues and PRs in the 10.0.0-alpha2 milestone.

Added

  • PHP cross-version:
    • 🌟 New PHPCompatibility.Keywords.ForbiddenClassAlias sniff. #1952
    • 🌟 New PHPCompatibility.LanguageConstructs.RemovedLanguageConstructs sniff. #1948
      This sniff in its initial version will detect the PHP 8.5 deprecation of the backtick operator.
  • PHP 8.3:
    • 🌟 New PHPCompatibility.ParameterValues.NewClassAliasInternalClass sniff. #1951
    • 🌟 New PHPCompatibility.Syntax.NewDynamicClassConstantFetch sniff. #1974
  • PHP 8.5:
    • 🌟 New PHPCompatibility.Classes.NewStaticAvizProperties sniff. #1950
  • ⭐ PHPCompatibility.Classes.NewClasses sniff: recognize the new DateTime and SQLite extension related error and exception classes as introduced in PHP 8.3. #1936, #1937
  • ⭐ PHPCompatibility.Constants.NewConstants sniff: recognize various constants from the Mhash extension. #1938
  • ⭐ PHPCompatibility.ParameterValues.ChangedIntToBoolParamType sniff: detect the Zlib $use_include_path parameter type change as per PHP 8.5. #1949
  • ⭐ The "list based" sniffs, like NewFunctions, RemovedIniDirectives, ForbiddenNames etc, have received updates to account for new/deprecated/removed PHP classes, constants, functions, function parameters, ini directives, reserved namespaces and type casts as per PHP 8.5.
  • πŸ“š Documentation for the following sniffs:
    • PHPCompatibility.Syntax.NewShortArray #1997

Changed

  • πŸ”€ PHPCompatibility.TypeCasts.RemovedTypeCasts has new error codes. #1941
    • The t_unset_castDeprecatedRemoved has been changed to unsetDeprecatedRemoved.
    • The t_double_castDeprecatedRemoved has been changed to realDeprecatedRemoved.
  • πŸ“Œ PHPCompatibility.Keywords.ForbiddenNames will now also detect incompatible use of the "other" reserved keywords parent and self. #1940
  • πŸ”§ β˜” Various housekeeping, including general maintenance, improvements to speed up the sniffs, improvements to CI, the tests and documentation.

Credits

Thanks go out to @afilina and @okkun-sh for their contributions to this version. πŸ‘

10.0.0-alpha1 - 2025-10-21

20 Oct 21:38
Immutable release. Only release title and notes can be modified.
de29923

Choose a tag to compare

Pre-release

IMPORTANT: This release contains breaking changes. Please read and follow the Upgrade guide in the wiki carefully before upgrading!

If you use any of the framework/CMS/polyfill specific rulesets, please use the corresponding release for that package.

Highlighted Changes

  • Policy change: As of this release, PHPCompatibility will no longer support a wide range of PHP_CodeSniffer versions.
    The minimum supported PHP_CodeSniffer version will be raised anytime syntax support for a new PHP feature is added to PHP_CodeSniffer and this syntax support is needed for the PHPCompatibility sniffs.
  • Policy change: As of this release, the only supported manner of installation of PHPCompatibility will be via Composer.
    Installation using git clones or with the PHP_CodeSniffer PHAR files is still possible, but no support will be provided for this.
  • New runtime dependencies:
    • The Composer plugin to register the standard with PHP_CodeSniffer.
    • PHPCSUtils, a library of utility function for PHP_CodeSniffer.
  • All PHPCompatibility sniffs are now final classes.
    • This prevents issues with sniff autoloading.
  • All sniffs are now compatible with PHP_CodeSniffer 3.x as well as 4.0.

Changelog for version 10.0.0-alpha1

See all related issues and PRs in the 10.0.0-alpha1 milestone and in the CHANGELOG file.

Added

  • New dependencies:
  • PHP cross-version:
    • 🌟 New PHPCompatibility.Classes.RemovedClasses sniff. #1062, #1705
  • PHP 5.3:
  • PHP 5.4:
    • 🌟 New PHPCompatibility.ParameterValues.ChangedObStartEraseFlags sniff. #1027, #1371, #1876
    • 🌟 New PHPCompatibility.ParameterValues.NewNumberFormatMultibyteSeparators sniff. #1139, #1380, #1679, #1680
  • PHP 7.0:
    • 🌟 New PHPCompatibility.Numbers.RemovedHexadecimalNumericStrings sniff. #1004, #1366. Fixes #1345
    • 🌟 New PHPCompatibility.ParameterValues.NewAssertCustomException sniff. #1029. Partially fixes #908
    • 🌟 New PHPCompatibility.Syntax.NewNestedStaticAccess sniff. #963, #1262. Fixes #946
  • PHP 7.2:
    • 🌟 New PHPCompatibility.ParameterValues.ForbiddenSessionModuleNameUser sniff. #1138, #1373
    • 🌟 New PHPCompatibility.ParameterValues.RemovedAssertStringAssertion sniff. #1028, #1282. Partially fixes #908
  • PHP 7.4:
    • 🌟 New PHPCompatibility.Numbers.NewNumericLiteralSeparator sniff. #984
    • 🌟 New PHPCompatibility.ParameterValues.RemovedProprietaryCSVEscaping sniff. #1787
  • PHP 8.0:
    • 🌟 New PHPCompatibility.Attributes.NewAttributes sniff. #1279, #1480, #1730, #1926
    • 🌟 New PHPCompatibility.Classes.ForbiddenExtendingFinalPHPClass sniff. #1486, #1739
    • 🌟 New PHPCompatibility.Classes.NewConstructorPropertyPromotion sniff. #1417
    • 🌟 New PHPCompatibility.ControlStructures.NewNonCapturingCatch sniff. #1151
    • 🌟 New PHPCompatibility.FunctionDeclarations.ForbiddenFinalPrivateMethods sniff. #1201
    • 🌟 New PHPCompatibility.FunctionDeclarations.NewTrailingComma sniff. #1164, #1190
    • 🌟 New PHPCompatibility.FunctionDeclarations.RemovedCallingDestructAfterConstructorExit sniff. #1200, #1227, #1283
    • 🌟 New PHPCompatibility.FunctionDeclarations.RemovedOptionalBeforeRequiredParam sniff. #1165, #1206, #1692, #1699, #1886
    • 🌟 New PHPCompatibility.FunctionUse.NewNamedParameters sniff. #1423, #1806, #1807
    • 🌟 New PHPCompatibility.ParameterValues.ChangedIntToBoolParamType sniff. #1232, #1370
    • 🌟 New PHPCompatibility.ParameterValues.ForbiddenGetClassNoArgsOutsideOO sniff. #1602
    • 🌟 New PHPCompatibility.ParameterValues.RemovedGetDefinedFunctionsExcludeDisabledFalse sniff. #1150, #1162, #1386, #1880
    • 🌟 New PHPCompatibility.ParameterValues.RemovedSplAutoloadRegisterThrowFalse sniff. #1181, #1391, #1882
    • 🌟 New PHPCompatibility.Syntax.InterpolatedStringDereferencing sniff. #1242
    • 🌟 New PHPCompatibility.Syntax.NewMagicConstantDereferencing sniff. #1233
  • PHP 8.1:
    • 🌟 New PHPCompatibility.Classes.NewFinalConstants sniff. #1317, #1496, #1629
    • 🌟 New PHPCompatibility.Classes.NewReadonlyProperties sniff. #1426
    • 🌟 New PHPCompatibility.FunctionDeclarations.RemovedReturnByReferenceFromVoid sniff. #1316, #1560
    • 🌟 New PHPCompatibility.InitialValue.NewNewInDefine sniff. #1465
    • 🌟 New PHPCompatibility.InitialValue.NewNewInInitializers sniff. #1464
    • 🌟 New PHPCompatibility.Interfaces.RemovedSerializable sniff. #1330
    • 🌟 New PHPCompatibility.Numbers.NewExplicitOctalNotation sniff. #1420
    • 🌟 New PHPCompatibility.ParameterValues.NewArrayMergeRecursiveWithGlobalsVar sniff. #1488
    • 🌟 New PHPCompatibility.ParameterValues.NewHTMLEntitiesFlagsDefault sniff. #1419
    • 🌟 New PHPCompatibility.ParameterValues.RemovedMbCheckEncodingNoArgs sniff. #1315
    • 🌟 New PHPCompatibility.ParameterValues.RemovedVersionCompareOperators sniff. #1418
    • 🌟 New PHPCompatibility.Syntax.NewFirstClassCallables sniff. #1425, #1807
    • 🌟 New PHPCompatibility.Variables.RemovedIndirectModificationOfGlobals sniff. #1487
  • PHP 8.2:
    • 🌟 New PHPCompatibility.Classes.NewReadonlyClasses sniff. #1453, #1686
    • 🌟 New PHPCompatibility.Constants.NewConstantsInTraits sniff. #1443
    • 🌟 New PHPCompatibility.ParameterValues.RemovedGetClassNoArgss sniff. #1614
    • 🌟 New PHPCompatibility.ParameterValues.RemovedLdapConnectSignatures sniff. #1620, #1671, #1881
    • 🌟 New PHPCompatibility.ParameterValues.RemovedMbStrimWidthNegativeWidth sniff. #1615
    • 🌟 New PHPCompatibility.TextStrings.RemovedDollarBraceStringEmbeds sniff. #1424
  • PHP 8.3:
    • 🌟 New PHPCompatibility.Classes.NewTypedConstants sniff. #1808
    • 🌟 New PHPCompatibility.Generators.NewYieldFromComment sniff. #1792, #1812
  • PHP 8.4:
    • 🌟 New PHPCompatibility.Classes.ForbiddenClassNameUnderscore sniff. #1742
    • 🌟 New PHPCompatibility.Classes.NewAbstractProperties sniff. #1901
    • 🌟 New PHPCompatibility.Classes.NewFinalProperties sniff. #1815
    • 🌟 New PHPCompatibility.FunctionDeclarations.RemovedImplicitlyNullableParam sniff. #1689, #1694, #1897
    • 🌟 New PHPCompatibility.Interfaces.NewPropertiesInInterfaces sniff. #1814
    • 🌟 New PHPCompatibility.ParameterValues.NewExitAsFunctionCall sniff. #1807, #1923
    • 🌟 New PHPCompatibility.ParameterValues.RemovedDbaKeySplitNullFalse sniff. #1745, #1879
    • 🌟 New PHPCompatibility.ParameterValues.RemovedTriggerErrorLevel sniff. #1741
    • 🌟 New PHPCompatibility.ParameterValues.RemovedXmlSetHandlerCallbackUnset sniff. #1744
    • 🌟 New PHPCompatibility.Syntax.NewClassMemberAccessWithoutParentheses sniff. #1903
  • ⭐ PHPCompatibility.Constants.NewMagicClassConstant: detection of $obj::class as allowed since PHP 8.0. #1166
  • ⭐ PHPCompatibility.Operators.NewOperators: detection of the PHP 8.0 nullsafe object operator. #1210
  • ⭐ All "list based" sniffs, like NewFunctions, RemovedIniDirectives, ForbiddenNames etc, have received updates to account for more new/deprecated/removed PHP classes, constants, functions, function parameters, hash algorithms, interfaces, ini directives, reserved keywords and type casts.
    The listed information in these sniffs has also received general accuracy and completeness updates.
  • ⭐ All type declaration related sniffs have received updates to account for new type keywords (like mixed and never) and new type syntaxes (union, intersection and DNF types) introduced in PHP.
  • ⭐ A number of Helper classes and traits (for internal use only - see #1484).
  • πŸ“š Documentation for the following sniffs:
    • PHPCompatibility.Classes.NewConstVisibility #1323
    • PHPCompatibility.FunctionNameRestrictions.RemovedPHP4StyleConstructors #1292
    • PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames #1293
    • PHPCompatibility.FunctionUse.ArgumentFunctionsReportCurrentValue #1294
    • PHPCompatibility.ParameterValues.RemovedPCREModifiers #1295
    • PHPCompatibility.UseStatements.NewGroupUseDeclarations #1470
    • PHPCompatibility.UseStatements.NewUseConstFunction #1470
    • PHPCompatibility.Variables.NewUniformVariableSyntax #1539
    • Additionally, nearly all newly added sniffs include documentation.

Changed

  • πŸ’• All sniffs are now cross-version compatibility with both PHP_CodeSniffer 3.x as well as 4.x. #1911
  • πŸ”₯ All PHPCompatibility sniffs are now final classes. #1261, #1273, #1875. Fixes #608, #638, #793, #1042
    Sniffs extending other sniffs can cause problems with the autoloading in PHP_CodeSniffer, leading to "class already declared" errors.
  • πŸ”€ The PHPCompatibility.Classes.ForbiddenAbstractPrivateMethods sniff has been renamed to PHPCompatibility.FunctionDeclarations.AbstractPrivateMethods and now also detects the PHP 8.0 change to allow abstract private methods in traits. #1149
  • πŸ”€ The PHPCompatibility.Miscellaneous.ValidIntegers has been moved to the Numbers category and is ...
Read more

PHPCompatibility 9.3.5

27 Dec 10:11
9fb3244

Choose a tag to compare

See all related issues and PRs in the 9.3.5 milestone.

Added

  • ⭐ PHPCompatibility.Classes.NewClasses sniff: recognize the new FFI extension related classes as introduced in PHP 7.4. #949
  • ⭐ PHPCompatibility.IniDirectives.NewIniDirectives sniff: detect use of the new FFI extension related ini directives as introduced in PHP 7.4. #949

Changed

  • πŸ“ PHPCompatibility.Syntax.NewShortArray: improved clarity of the error message and made it consistent with other error messages in this standard. #934
  • πŸ“ PHPCompatibility.Interfaces.NewInterfaces: updated the URL which is mentioned in select error messages. #942
  • ♻️ Another slew of code documentation fixes. #937, #939, #940, #941, #943, #944, #951, #950. Fixes #734.
  • πŸ’š Travis: various tweaks. The builds against PHP 7.4 are no longer allowed to fail. #935, #938
    For running the sniffs on PHP 7.4, it is recommended to use PHP_CodeSniffer 3.5.0+ as PHP_CodeSniffer itself is not compatible with PHP 7.4 until version 3.5.0.

Fixed

  • πŸ› PHPCompatibility.Classes.NewClasses: two new PHP 7.4 classes were being checked as if they were Exceptions. #945

Credits

Thanks go out to William Entriken for their contribution to this version. πŸ‘

PHPCompatibility 9.3.4

15 Nov 04:38
1f37659

Choose a tag to compare

See all related issues and PRs in the 9.3.4 milestone.

Fixed

  • πŸ› PHPCompatibility.Keywords.ForbiddenNames: false positive for list when used in a foreach() condition. #930. Fixes #928, #929

Credits

Thanks go out to Sergii Bondarenko for their contribution to this version. πŸ‘

PHPCompatibility 9.3.3

11 Nov 03:52
1af08ca

Choose a tag to compare

See all related issues and PRs in the 9.3.3 milestone.

Added

  • ⭐ PHPCompatibility.Constants.NewConstants sniff: detection of yet more (undocumented) PHP 7.2 Sodium constants. #924
  • ⭐ PHPCompatibility.Keywords.ForbiddenNames sniff: detect the use of more reserved keywords which are not allowed to be used to name certain constructs. #923. Fixes #922

Fixed

  • πŸ› PHPCompatibility.FunctionNameRestrictions.RemovedPHP4StyleConstructors: false positive detecting PHP4-style constructors when declared in interfaces. The class implementing the interface will not have the same name as the interface, so the actual method would not be regarded as a PHP4 style constructor. #921

Credits

Thanks go out to Nikhil for their contribution to this version. πŸ‘

PHPCompatibility 9.3.2

17 Oct 02:13
bfca2be

Choose a tag to compare

See all related issues and PRs in the 9.3.2 milestone.

Added

  • ⭐ PHPCompatibility.Constants.NewConstants sniff: detection of the PHP 7.2 SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13 constant. #915
  • πŸ“š Readme: a list of projects which are build upon or extend PHPCompatibility. #904

Changed

  • πŸ“Œ PHPCompatibility.FunctionNameRestrictions.RemovedPHP4StyleConstructors: minor efficiency fix to make the sniff faster. #912
  • πŸ“Œ PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames: functions marked as @deprecated in the function docblock will now be ignored by this sniff. #917. Fixes #911
  • πŸ“ PHPCompatibility.FunctionDeclarations.ForbiddenToStringParameters: the $ooScopeTokens property is now protected, it should never have been public in the first place. #907
  • ♻️ More code documentation fixes. #903, #916
  • πŸ“š Readme/Contributing: various tweaks. #904, #905

Fixed

  • πŸ› PHPCompatibility.FunctionUse.OptionalToRequiredFunctionParameters: false positive when a class is instantiated which has the same name as one of the affected functions. #914. Fixes #913
  • πŸ› PHPCompatibility.FunctionUse.RequiredToOptionalFunctionParameters: false positive when a class is instantiated which has the same name as one of the affected functions. #914
  • πŸ› PHPCompatibility.MethodUse.NewDirectCallsToClone: false positive on calling __clone() from within the class being cloned #910. Fixes #629 (comment)
  • πŸ› PHPCompatibility.Miscellaneous.ValidIntegers: binary numbers using an uppercase B were not always recognized correctly. #909

PHPCompatibility 9.3.1

05 Sep 18:37
9999344

Choose a tag to compare

See all related issues and PRs in the 9.3.1 milestone.

Changed

Fixed

  • πŸ› PHPCompatibility.ParameterValues.RemovedImplodeFlexibleParamOrder: false positive when an array item in the second parameter contained a ternary. #891. Fixes #890
  • πŸ› PHPCompatibility.ParameterValues.RemovedImplodeFlexibleParamOrder: will now take array casts into account when determining which parameter is $pieces. #891.
  • πŸ› PHPCompatibility.ParameterValues.RemovedImplodeFlexibleParamOrder: hardening of the logic to not examine the second parameter when the first is just and only a text string ($glue). #891.

PHPCompatibility 9.3.0

28 Aug 15:31
06cc8d2

Choose a tag to compare

See all related issues and PRs in the 9.3.0 milestone.

To keep informed of the progress of covering "everything PHP 7.4" in PHPCompatibility, please subscribe to issue #808.

Changes expected in PHPCompatibility 10.0.0

The next version of PHPCompatibility is expected to include a new external dependency.

In this same release, support for PHP < 5.4 and PHP_CodeSniffer < 2.6.0 will be dropped.

The 10.0.0 release is expected around the same time as the release of PHP 7.4 - end of November/beginning of December 2019.

Added

  • 🌟 New PHPCompatibility.Miscellaneous.NewPHPOpenTagEOF sniff to detect a stand-alone PHP open tag at the end of a file, without trailing newline, as will be supported as of PHP 7.4. #843
  • 🌟 New PHPCompatibility.ParameterValues.ForbiddenStripTagsSelfClosingXHTML sniff to detect calls to strip_tags() passing self-closing XHTML tags in the $allowable_tags parameter. This has not been supported since PHP 5.3.4. #866
  • 🌟 New PHPCompatibility.ParameterValues.NewHTMLEntitiesEncodingDefault sniff to detect calls to html_entity_decode(), htmlentities() and htmlspecialchars() which are impacted by the change to the default value of the $encoding parameter in PHP 5.4. #862
  • 🌟 New PHPCompatibility.ParameterValues.NewIconvMbstringCharsetDefault sniff to detect code impacted by the change in the default_charset value in PHP 5.6. #864 Fixes #839
  • 🌟 New PHPCompatibility.ParameterValues.NewIDNVariantDefault sniff to detect calls to idn_to_ascii() and idn_to_utf8() impacted by the PHP 7.4 change in the default value for the $variant parameter. #861
  • 🌟 New PHPCompatibility.ParameterValues.NewPasswordAlgoConstantValues sniff to detect calls to password_hash() and password_needs_rehash() impacted by the changed value of the PASSWORD_DEFAULT, PASSWORD_BCRYPT, PASSWORD_ARGON2I and PASSWORD_ARGON2ID constants in PHP 7.4. #865
  • 🌟 New PHPCompatibility.ParameterValues.NewProcOpenCmdArray sniff to detect calls to proc_open() passing an array for the $cmd parameter as supported as of PHP 7.4. #869
  • 🌟 New PHPCompatibility.ParameterValues.NewStripTagsAllowableTagsArray sniff to detect calls to strip_tags() passing an array for the $allowable_tags parameter as will be supported as of PHP 7.4. #867
  • 🌟 New PHPCompatibility.ParameterValues.RemovedImplodeFlexibleParamOrder sniff to detect implode() being called with $glue and $pieces in reverse order from the documented argument order. This was previously allowed for historical reasons, but will be deprecated in PHP 7.4. #846
  • 🌟 New PHPCompatibility.ParameterValues.RemovedMbStrrposEncodingThirdParam sniff to detect the $encoding being passed as the third, instead of the fourth parameter, to mb_strrpos() as has been soft deprecated since PHP 5.2 and will be hard deprecated as of PHP 7.4. #860
  • 🌟 New PHPCompatibility.Syntax.RemovedCurlyBraceArrayAccess sniff to detect array and string offset access using curly braces as will be deprecated as of PHP 7.4. #855
    • In contrast to any other sniff in the PHPCompatibility standard, this sniff contains an auto-fixer.
  • 🌟 New PHPCompatibility.TextStrings.NewUnicodeEscapeSequence sniff to detect use of the PHP 7.0+ unicode codepoint escape sequences and issues with invalid sequences. #856
  • 🌟 New PHPCompatibility.Upgrade.LowPHP sniff to give users of old PHP versions advance warning when support will be dropped in the near future. #838
    At this moment, the intention is to drop support for PHP 5.3 by the end of this year.
  • ⭐ PHPCompatibility.Classes.NewClasses sniff: recognize the new WeakReference class as introduced in PHP 7.4. #857
  • ⭐ PHPCompatibility.Constants.NewConstants sniff: detection of new Curl constants as introduced in PHP 7.3.5. #878
  • ⭐ PHPCompatibility.Constants.NewConstants sniff: detection of the revived T_BAD_CHARACTER constant as re-introduced in PHP 7.4. #882
  • ⭐ PHPCompatibility.Constants.NewConstants sniff: detection of the new IMG_FILTER_SCATTER and PASSWORD_ARGON2_PROVIDER constants as introduced in PHP 7.4. #887
  • ⭐ PHPCompatibility.Constants.RemovedConstants sniff: detection of use of the CURLPIPE_HTTP1 constant which will be deprecated in PHP 7.4. #879
  • ⭐ PHPCompatibility.Constants.RemovedConstants sniff: detection of use of the FILTER_SANITIZE_MAGIC_QUOTES constant which will be deprecated in PHP 7.4. #845
  • ⭐ PHPCompatibility.Constants.RemovedConstants sniff: detection of use of the T_CHARACTER and T_BAD_CHARACTER constants which were removed in PHP 7.0. #882
  • ⭐ PHPCompatibility.FunctionDeclarations.NewMagicMethods sniff: recognize the new __serialize() and __unserialize() magic methods as introduced in PHP 7.4. #868
  • ⭐ PHPCompatibility.FunctionDeclarations.NewMagicMethods sniff: recognize the PHP 5.0 __construct() and __destruct() magic methods. #884
  • ⭐ PHPCompatibility.FunctionDeclarations.NonStaticMagicMethods sniff: recognize the new __serialize() and __unserialize() magic methods as introduced in PHP 7.4. #868
  • ⭐ PHPCompatibility.FunctionUse.NewFunctions sniff: recognize the new PHP 7.4 function imagecreatefromtga(). #873
  • ⭐ PHPCompatibility.FunctionUse.RemovedFunctionParameters sniff: recognize the deprecation of the $age parameter of the curl_version() function. #874
  • ⭐ PHPCompatibility.FunctionUse.RemovedFunctions sniff: recognize the PHP 7.4 deprecated convert_cyr_string()(), ezmlm_hash(), get_magic_quotes_gpc(), get_magic_quotes_runtime(), hebrevc(), is_real(), money_format() and restore_include_path() functions. #847
  • ⭐ PHPCompatibility.IniDirectives.NewIniDirectives sniff: detect use of the new PHP 7.4 zend.exception_ignore_args ini directive. #871
  • ⭐ PHPCompatibility.IniDirectives.RemovedIniDirectives sniff: detect use of the allow_url_include ini directive which is deprecated as of PHP 7.4. #870
  • ⭐ PHPCompatibility.IniDirectives.RemovedIniDirectives sniff: detection of use of the opcache.load_comments directive which was removed in PHP 7.0. #883
  • ⭐ PHPCompatibility.ParameterValues.NewHashAlgorithms: recognize use of the new PHP 7.4 crc32c hash algorithm. #872
  • ⭐ PHPCompatibility.TypeCasts.RemovedTypeCasts sniff: detect usage of the (real) type cast which will be deprecated in PHP 7.4. #844
  • ⭐ Recognize the recode extension functionality which will be removed in PHP 7.4 (moved to PECL) in the RemovedExtensions and RemovedFunctions sniffs. #841
  • ⭐ Recognize the OPcache extension functionality which was be introduced in PHP 5.5, but not yet fully accounted for in the NewFunctions and NewIniDirectives sniffs. #883
  • ⭐ New getCompleteTextString() utility method to the PHPCompatibility\Sniff class. #856
  • β˜” Unit test for the PHPCompatibility.Upgrade.LowPHPCS sniff.
  • β˜” Some extra unit tests for the PHPCompatibility.ParameterValues.NewNegativeStringOffset, PHPCompatibility.ParameterValues.RemovedMbStringModifiers and sniffs. #876, #877
  • πŸ“š CONTRIBUTING.md: Added a list of typical sources for information about changes to PHP. #875

Changed

  • :pushp...
Read more

PHPCompatibility 9.2.0

27 Jun 20:47
3db1bf1

Choose a tag to compare

See all related issues and PRs in the 9.2.0 milestone.

To keep informed of the progress of covering "everything PHP 7.4" in PHPCompatibility, please subscribe to issue #808.

Added

  • 🌟 New PHPCompatibility.Classes.ForbiddenAbstractPrivateMethods sniff to detect methods declared as both private as well as abstract. This was allowed between PHP 5.0.0 and 5.0.4, but disallowed in PHP 5.1 as the behaviour of private and abstract are mutually exclusive. #822
  • 🌟 New PHPCompatibility.Classes.NewTypedProperties sniff to detect PHP 7.4 typed property declarations. #801, #829
  • 🌟 New PHPCompatibility.Classes.RemovedOrphanedParent sniff to detect the use of the parent keyword in classes without a parent (non-extended classes). This code pattern is deprecated in PHP 7.4 and will become a compile-error in PHP 8.0. #818
  • 🌟 New PHPCompatibility.FunctionDeclarations.NewExceptionsFromToString sniff to detect throwing exceptions from __toString() methods. This would previously result in a fatal error, but will be allowed as of PHP 7.4. #814
  • 🌟 New PHPCompatibility.FunctionDeclarations.ForbiddenToStringParameters sniff to detect __toString() function declarations expecting parameters. This was disallowed in PHP 5.3. #815
  • 🌟 New PHPCompatibility.MethodUse.ForbiddenToStringParameters sniff to detect direct calls to __toString() magic methods passing parameters. This was disallowed in PHP 5.3. #830
  • 🌟 New PHPCompatibility.Operators.ChangedConcatOperatorPrecedence sniff to detect code affected by the upcoming change in operator precedence for the concatenation operator. The concatenation operator precedence will be lowered in PHP 8.0, with deprecation notices for code affected being thrown in PHP 7.4. #805
  • 🌟 New PHPCompatibility.Operators.RemovedTernaryAssociativity sniff to detect code relying on left-associativity of the ternary operator. This behaviour will be deprecated in PHP 7.4 and removed in PHP 8.0. #810
  • 🌟 New PHPCompatibility.Syntax.NewArrayUnpacking sniff to detect the use of the spread operator to unpack arrays when declaring a new array, as introduced in PHP 7.4. #804
  • ⭐ PHPCompatibility.Classes.NewClasses sniff: recognize the new ReflectionReference class as introduced in PHP 7.4. #820
  • ⭐ PHPCompatibility.Constants.NewConstants sniff: detection of the new PHP 7.4 Core (Standard), MBString, Socket and Tidy constants. #821
  • ⭐ PHPCompatibility.FunctionUse.NewFunctions sniff: detect usage of the new PHP 7.4 get_mangled_object_vars(), mb_str_split(), openssl_x509_verify(), password_algos(), pcntl_unshare(), sapi_windows_set_ctrl_handler() and sapi_windows_generate_ctrl_event() functions. #811, #819, #827
  • ⭐ PHPCompatibility.FunctionUse.NewFunctions sniff: recognize the new OCI functions as introduced in PHP 7.2.14 and PHP 7.3.1. #786
  • ⭐ PHPCompatibility.FunctionUse.RemovedFunctions sniff: recognize the PHP 7.4 deprecated ldap_control_paged_result_response() and ldap_control_paged_result() functions. #831
  • ⭐ PHPCompatibility.FunctionUse.RemovedFunctions sniff: recognize the Payflow Pro/pfpro functions as removed in PHP 5.1. #823
  • ⭐ PHPCompatibility.FunctionUse.RequiredToOptionalFunctionParameters sniff: account for the parameters for array_merge() and array_merge_recursive() becoming optional in PHP 7.4. #817
  • ⭐ PHPCompatibility.IniDirectives.RemovedIniDirectives sniff: recognize the Payflow Pro/pfpro ini directives as removed in PHP 5.1. #823
  • ⭐ Recognize the interbase/Firebird extension functionality which will be removed in PHP 7.4 (moved to PECL) in the RemovedConstants, RemovedExtensions, RemovedFunctions and RemovedIniDirectives sniffs. #807
  • ⭐ Recognize the wddx extension functionality which will be removed in PHP 7.4 (moved to PECL) in the RemovedExtensions and RemovedFunctions sniffs. #826
  • ⭐ New isShortTernary() and isUnaryPlusMinus() utility methods to the PHPCompatibility\Sniff class. #810, #805

Changed

  • ✏️ The PHPCompatibility.Extensions.RemovedExtensions sniff will now only report on the removed Payflow Pro extension when a function uses pfpro_ as a prefix. Previously, it used the pfpro prefix (without underscore) for detection. #812
  • ✏️ The error message thrown when the T_ELLIPSIS token, i.e. the spread operator, is detected. #803
    PHP 7.4 adds a third use-case for the spread operator. The adjusted error message accounts for this.
  • β˜” PHPCompatibility.FunctionDeclarations.NewParamTypeDeclarations is now also tested with parameters using the splat operator. #802
  • πŸ“š The documentation now uses the GitHub repo of PHP_CodeSniffer as the canonical entry point for PHP_CodeSniffer. Previously, it would point to the PEAR package. #788
  • πŸ“š The links in the changelog now all point to the PHPCompatibility/PHPCompatibility repo and no longer to the (deprecated) wimg/PHPCompatibility repo. #828
  • ♻️ Various minor inline documentation improvements. #825
  • πŸ”§ Various performance optimizations and code simplifications. #783, #784, #795, #813
  • πŸ’š Travis: build tests are now being run against PHP 7.4 (unstable) as well. #790
    Note: the builds are currently not (yet) tested against PHP 8.0 (unstable) as there is no compatible PHPUnit version available (yet).
  • πŸ”§ Travis: The build script has been refactored to use stages to get the most relevant results faster. Additionally some more tweaks have been made to improve and/or simplify the build script. #798
  • πŸ”§ Build/PHPCS: warnings are no longer allowed for the PHPCompatibility native code. #800
  • πŸ”§ Build/PHPCS: added variable assignment alignment check and file include check to the PHPCompatibility native CS configuration. #824
  • πŸ”§ The minimum version for the recommended DealerDirect/phpcodesniffer-composer-installer Composer plugin has been upped to 0.5.0. #791

Fixed

  • πŸ› The PHPCompatibility.Extensions.RemovedExtensions sniff contained a typo in the alternative recommended for the removed mcve extension. #806
  • πŸ› The PHPCompatibility.Extensions.RemovedExtensions sniff listed the wrong removal version number for the Payflow Pro/pfpro extension (PHP 5.3 instead of the correct 5.1). #823

Credits

Thanks go out to YΔ±lmaz and Tim Millwood for their contribution to this version. πŸ‘

PHPCompatibility 9.1.1

31 Dec 00:44
2b63c5d

Choose a tag to compare

See all related issues and PRs in the 9.1.1 milestone.

Fixed

  • πŸ› ForbiddenThisUseContexts: false positive for unsetting $this['key'] on objects implementing ArrayAccess. #781. Fixes #780