Releases: PHPCompatibility/PHPCompatibility
10.0.0-alpha2 - 2025-11-28
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:
- PHP 8.3:
- PHP 8.5:
- π New
PHPCompatibility.Classes.NewStaticAvizPropertiessniff. #1950
- π New
- β
PHPCompatibility.Classes.NewClassessniff: recognize the new DateTime and SQLite extension related error and exception classes as introduced in PHP 8.3. #1936, #1937 - β
PHPCompatibility.Constants.NewConstantssniff: recognize various constants from the Mhash extension. #1938 - β
PHPCompatibility.ParameterValues.ChangedIntToBoolParamTypesniff: detect the Zlib$use_include_pathparameter type change as per PHP 8.5. #1949 - β The "list based" sniffs, like
NewFunctions,RemovedIniDirectives,ForbiddenNamesetc, 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.RemovedTypeCastshas new error codes. #1941- The
t_unset_castDeprecatedRemovedhas been changed tounsetDeprecatedRemoved. - The
t_double_castDeprecatedRemovedhas been changed torealDeprecatedRemoved.
- The
- π
PHPCompatibility.Keywords.ForbiddenNameswill now also detect incompatible use of the "other" reserved keywordsparentandself. #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
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
finalclasses.- 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:
- PHP 5.3:
- PHP 5.4:
- PHP 7.0:
- PHP 7.2:
- PHP 7.4:
- PHP 8.0:
- π New
PHPCompatibility.Attributes.NewAttributessniff. #1279, #1480, #1730, #1926 - π New
PHPCompatibility.Classes.ForbiddenExtendingFinalPHPClasssniff. #1486, #1739 - π New
PHPCompatibility.Classes.NewConstructorPropertyPromotionsniff. #1417 - π New
PHPCompatibility.ControlStructures.NewNonCapturingCatchsniff. #1151 - π New
PHPCompatibility.FunctionDeclarations.ForbiddenFinalPrivateMethodssniff. #1201 - π New
PHPCompatibility.FunctionDeclarations.NewTrailingCommasniff. #1164, #1190 - π New
PHPCompatibility.FunctionDeclarations.RemovedCallingDestructAfterConstructorExitsniff. #1200, #1227, #1283 - π New
PHPCompatibility.FunctionDeclarations.RemovedOptionalBeforeRequiredParamsniff. #1165, #1206, #1692, #1699, #1886 - π New
PHPCompatibility.FunctionUse.NewNamedParameterssniff. #1423, #1806, #1807 - π New
PHPCompatibility.ParameterValues.ChangedIntToBoolParamTypesniff. #1232, #1370 - π New
PHPCompatibility.ParameterValues.ForbiddenGetClassNoArgsOutsideOOsniff. #1602 - π New
PHPCompatibility.ParameterValues.RemovedGetDefinedFunctionsExcludeDisabledFalsesniff. #1150, #1162, #1386, #1880 - π New
PHPCompatibility.ParameterValues.RemovedSplAutoloadRegisterThrowFalsesniff. #1181, #1391, #1882 - π New
PHPCompatibility.Syntax.InterpolatedStringDereferencingsniff. #1242 - π New
PHPCompatibility.Syntax.NewMagicConstantDereferencingsniff. #1233
- π New
- PHP 8.1:
- π New
PHPCompatibility.Classes.NewFinalConstantssniff. #1317, #1496, #1629 - π New
PHPCompatibility.Classes.NewReadonlyPropertiessniff. #1426 - π New
PHPCompatibility.FunctionDeclarations.RemovedReturnByReferenceFromVoidsniff. #1316, #1560 - π New
PHPCompatibility.InitialValue.NewNewInDefinesniff. #1465 - π New
PHPCompatibility.InitialValue.NewNewInInitializerssniff. #1464 - π New
PHPCompatibility.Interfaces.RemovedSerializablesniff. #1330 - π New
PHPCompatibility.Numbers.NewExplicitOctalNotationsniff. #1420 - π New
PHPCompatibility.ParameterValues.NewArrayMergeRecursiveWithGlobalsVarsniff. #1488 - π New
PHPCompatibility.ParameterValues.NewHTMLEntitiesFlagsDefaultsniff. #1419 - π New
PHPCompatibility.ParameterValues.RemovedMbCheckEncodingNoArgssniff. #1315 - π New
PHPCompatibility.ParameterValues.RemovedVersionCompareOperatorssniff. #1418 - π New
PHPCompatibility.Syntax.NewFirstClassCallablessniff. #1425, #1807 - π New
PHPCompatibility.Variables.RemovedIndirectModificationOfGlobalssniff. #1487
- π New
- PHP 8.2:
- π New
PHPCompatibility.Classes.NewReadonlyClassessniff. #1453, #1686 - π New
PHPCompatibility.Constants.NewConstantsInTraitssniff. #1443 - π New
PHPCompatibility.ParameterValues.RemovedGetClassNoArgsssniff. #1614 - π New
PHPCompatibility.ParameterValues.RemovedLdapConnectSignaturessniff. #1620, #1671, #1881 - π New
PHPCompatibility.ParameterValues.RemovedMbStrimWidthNegativeWidthsniff. #1615 - π New
PHPCompatibility.TextStrings.RemovedDollarBraceStringEmbedssniff. #1424
- π New
- PHP 8.3:
- PHP 8.4:
- π New
PHPCompatibility.Classes.ForbiddenClassNameUnderscoresniff. #1742 - π New
PHPCompatibility.Classes.NewAbstractPropertiessniff. #1901 - π New
PHPCompatibility.Classes.NewFinalPropertiessniff. #1815 - π New
PHPCompatibility.FunctionDeclarations.RemovedImplicitlyNullableParamsniff. #1689, #1694, #1897 - π New
PHPCompatibility.Interfaces.NewPropertiesInInterfacessniff. #1814 - π New
PHPCompatibility.ParameterValues.NewExitAsFunctionCallsniff. #1807, #1923 - π New
PHPCompatibility.ParameterValues.RemovedDbaKeySplitNullFalsesniff. #1745, #1879 - π New
PHPCompatibility.ParameterValues.RemovedTriggerErrorLevelsniff. #1741 - π New
PHPCompatibility.ParameterValues.RemovedXmlSetHandlerCallbackUnsetsniff. #1744 - π New
PHPCompatibility.Syntax.NewClassMemberAccessWithoutParenthesessniff. #1903
- π New
- β
PHPCompatibility.Constants.NewMagicClassConstant: detection of$obj::classas 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,ForbiddenNamesetc, 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
mixedandnever) 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
finalclasses. #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.ForbiddenAbstractPrivateMethodssniff has been renamed toPHPCompatibility.FunctionDeclarations.AbstractPrivateMethodsand now also detects the PHP 8.0 change to allowabstract privatemethods in traits. #1149 - π The
PHPCompatibility.Miscellaneous.ValidIntegershas been moved to theNumberscategory and is ...
PHPCompatibility 9.3.5
See all related issues and PRs in the 9.3.5 milestone.
Added
- β
PHPCompatibility.Classes.NewClassessniff: recognize the newFFIextension related classes as introduced in PHP 7.4. #949 - β
PHPCompatibility.IniDirectives.NewIniDirectivessniff: detect use of the newFFIextension 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
See all related issues and PRs in the 9.3.4 milestone.
Fixed
- π
PHPCompatibility.Keywords.ForbiddenNames: false positive forlistwhen used in aforeach()condition. #930. Fixes #928, #929
Credits
Thanks go out to Sergii Bondarenko for their contribution to this version. π
PHPCompatibility 9.3.3
See all related issues and PRs in the 9.3.3 milestone.
Added
- β
PHPCompatibility.Constants.NewConstantssniff: detection of yet more (undocumented) PHP 7.2 Sodium constants. #924 - β
PHPCompatibility.Keywords.ForbiddenNamessniff: 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
See all related issues and PRs in the 9.3.2 milestone.
Added
- β
PHPCompatibility.Constants.NewConstantssniff: detection of the PHP 7.2SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13constant. #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@deprecatedin the function docblock will now be ignored by this sniff. #917. Fixes #911 - π
PHPCompatibility.FunctionDeclarations.ForbiddenToStringParameters: the$ooScopeTokensproperty is nowprotected, it should never have beenpublicin 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 uppercaseBwere not always recognized correctly. #909
PHPCompatibility 9.3.1
See all related issues and PRs in the 9.3.1 milestone.
Changed
- β»οΈ A whole slew of code documentation fixes. #892, #895, #896, #897, #898, #899, #900
- π§ Travis: minor tweaks to the build script. #893
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
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.NewPHPOpenTagEOFsniff 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.ForbiddenStripTagsSelfClosingXHTMLsniff to detect calls tostrip_tags()passing self-closing XHTML tags in the$allowable_tagsparameter. This has not been supported since PHP 5.3.4. #866 - π New
PHPCompatibility.ParameterValues.NewHTMLEntitiesEncodingDefaultsniff to detect calls tohtml_entity_decode(),htmlentities()andhtmlspecialchars()which are impacted by the change to the default value of the$encodingparameter in PHP 5.4. #862 - π New
PHPCompatibility.ParameterValues.NewIconvMbstringCharsetDefaultsniff to detect code impacted by the change in thedefault_charsetvalue in PHP 5.6. #864 Fixes #839 - π New
PHPCompatibility.ParameterValues.NewIDNVariantDefaultsniff to detect calls toidn_to_ascii()andidn_to_utf8()impacted by the PHP 7.4 change in the default value for the$variantparameter. #861 - π New
PHPCompatibility.ParameterValues.NewPasswordAlgoConstantValuessniff to detect calls topassword_hash()andpassword_needs_rehash()impacted by the changed value of thePASSWORD_DEFAULT,PASSWORD_BCRYPT,PASSWORD_ARGON2IandPASSWORD_ARGON2IDconstants in PHP 7.4. #865 - π New
PHPCompatibility.ParameterValues.NewProcOpenCmdArraysniff to detect calls toproc_open()passing an array for the$cmdparameter as supported as of PHP 7.4. #869 - π New
PHPCompatibility.ParameterValues.NewStripTagsAllowableTagsArraysniff to detect calls tostrip_tags()passing an array for the$allowable_tagsparameter as will be supported as of PHP 7.4. #867 - π New
PHPCompatibility.ParameterValues.RemovedImplodeFlexibleParamOrdersniff to detectimplode()being called with$glueand$piecesin 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.RemovedMbStrrposEncodingThirdParamsniff to detect the$encodingbeing passed as the third, instead of the fourth parameter, tomb_strrpos()as has been soft deprecated since PHP 5.2 and will be hard deprecated as of PHP 7.4. #860 - π New
PHPCompatibility.Syntax.RemovedCurlyBraceArrayAccesssniff 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.NewUnicodeEscapeSequencesniff to detect use of the PHP 7.0+ unicode codepoint escape sequences and issues with invalid sequences. #856 - π New
PHPCompatibility.Upgrade.LowPHPsniff 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.NewClassessniff: recognize the newWeakReferenceclass as introduced in PHP 7.4. #857 - β
PHPCompatibility.Constants.NewConstantssniff: detection of new Curl constants as introduced in PHP 7.3.5. #878 - β
PHPCompatibility.Constants.NewConstantssniff: detection of the revivedT_BAD_CHARACTERconstant as re-introduced in PHP 7.4. #882 - β
PHPCompatibility.Constants.NewConstantssniff: detection of the newIMG_FILTER_SCATTERandPASSWORD_ARGON2_PROVIDERconstants as introduced in PHP 7.4. #887 - β
PHPCompatibility.Constants.RemovedConstantssniff: detection of use of theCURLPIPE_HTTP1constant which will be deprecated in PHP 7.4. #879 - β
PHPCompatibility.Constants.RemovedConstantssniff: detection of use of theFILTER_SANITIZE_MAGIC_QUOTESconstant which will be deprecated in PHP 7.4. #845 - β
PHPCompatibility.Constants.RemovedConstantssniff: detection of use of theT_CHARACTERandT_BAD_CHARACTERconstants which were removed in PHP 7.0. #882 - β
PHPCompatibility.FunctionDeclarations.NewMagicMethodssniff: recognize the new__serialize()and__unserialize()magic methods as introduced in PHP 7.4. #868 - β
PHPCompatibility.FunctionDeclarations.NewMagicMethodssniff: recognize the PHP 5.0__construct()and__destruct()magic methods. #884 - β
PHPCompatibility.FunctionDeclarations.NonStaticMagicMethodssniff: recognize the new__serialize()and__unserialize()magic methods as introduced in PHP 7.4. #868 - β
PHPCompatibility.FunctionUse.NewFunctionssniff: recognize the new PHP 7.4 functionimagecreatefromtga(). #873 - β
PHPCompatibility.FunctionUse.RemovedFunctionParameterssniff: recognize the deprecation of the$ageparameter of thecurl_version()function. #874 - β
PHPCompatibility.FunctionUse.RemovedFunctionssniff: recognize the PHP 7.4 deprecatedconvert_cyr_string()(),ezmlm_hash(),get_magic_quotes_gpc(),get_magic_quotes_runtime(),hebrevc(),is_real(),money_format()andrestore_include_path()functions. #847 - β
PHPCompatibility.IniDirectives.NewIniDirectivessniff: detect use of the new PHP 7.4zend.exception_ignore_argsini directive. #871 - β
PHPCompatibility.IniDirectives.RemovedIniDirectivessniff: detect use of theallow_url_includeini directive which is deprecated as of PHP 7.4. #870 - β
PHPCompatibility.IniDirectives.RemovedIniDirectivessniff: detection of use of theopcache.load_commentsdirective which was removed in PHP 7.0. #883 - β
PHPCompatibility.ParameterValues.NewHashAlgorithms: recognize use of the new PHP 7.4crc32chash algorithm. #872 - β
PHPCompatibility.TypeCasts.RemovedTypeCastssniff: detect usage of the(real)type cast which will be deprecated in PHP 7.4. #844 - β Recognize the
recodeextension functionality which will be removed in PHP 7.4 (moved to PECL) in theRemovedExtensionsandRemovedFunctionssniffs. #841 - β Recognize the
OPcacheextension functionality which was be introduced in PHP 5.5, but not yet fully accounted for in theNewFunctionsandNewIniDirectivessniffs. #883 - β New
getCompleteTextString()utility method to thePHPCompatibility\Sniffclass. #856 - β Unit test for the
PHPCompatibility.Upgrade.LowPHPCSsniff. - β Some extra unit tests for the
PHPCompatibility.ParameterValues.NewNegativeStringOffset,PHPCompatibility.ParameterValues.RemovedMbStringModifiersand sniffs. #876, #877 - π
CONTRIBUTING.md: Added a list of typical sources for information about changes to PHP. #875
Changed
- :pushp...
PHPCompatibility 9.2.0
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.ForbiddenAbstractPrivateMethodssniff to detect methods declared as bothprivateas well asabstract. This was allowed between PHP 5.0.0 and 5.0.4, but disallowed in PHP 5.1 as the behaviour ofprivateandabstractare mutually exclusive. #822 - π New
PHPCompatibility.Classes.NewTypedPropertiessniff to detect PHP 7.4 typed property declarations. #801, #829 - π New
PHPCompatibility.Classes.RemovedOrphanedParentsniff to detect the use of theparentkeyword 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.NewExceptionsFromToStringsniff 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.ForbiddenToStringParameterssniff to detect__toString()function declarations expecting parameters. This was disallowed in PHP 5.3. #815 - π New
PHPCompatibility.MethodUse.ForbiddenToStringParameterssniff to detect direct calls to__toString()magic methods passing parameters. This was disallowed in PHP 5.3. #830 - π New
PHPCompatibility.Operators.ChangedConcatOperatorPrecedencesniff 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.RemovedTernaryAssociativitysniff 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.NewArrayUnpackingsniff 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.NewClassessniff: recognize the newReflectionReferenceclass as introduced in PHP 7.4. #820 - β
PHPCompatibility.Constants.NewConstantssniff: detection of the new PHP 7.4 Core (Standard), MBString, Socket and Tidy constants. #821 - β
PHPCompatibility.FunctionUse.NewFunctionssniff: detect usage of the new PHP 7.4get_mangled_object_vars(),mb_str_split(),openssl_x509_verify(),password_algos(),pcntl_unshare(),sapi_windows_set_ctrl_handler()andsapi_windows_generate_ctrl_event()functions. #811, #819, #827 - β
PHPCompatibility.FunctionUse.NewFunctionssniff: recognize the new OCI functions as introduced in PHP 7.2.14 and PHP 7.3.1. #786 - β
PHPCompatibility.FunctionUse.RemovedFunctionssniff: recognize the PHP 7.4 deprecatedldap_control_paged_result_response()andldap_control_paged_result()functions. #831 - β
PHPCompatibility.FunctionUse.RemovedFunctionssniff: recognize thePayflow Pro/pfprofunctions as removed in PHP 5.1. #823 - β
PHPCompatibility.FunctionUse.RequiredToOptionalFunctionParameterssniff: account for the parameters forarray_merge()andarray_merge_recursive()becoming optional in PHP 7.4. #817 - β
PHPCompatibility.IniDirectives.RemovedIniDirectivessniff: recognize thePayflow Pro/pfproini directives as removed in PHP 5.1. #823 - β Recognize the
interbase/Firebirdextension functionality which will be removed in PHP 7.4 (moved to PECL) in theRemovedConstants,RemovedExtensions,RemovedFunctionsandRemovedIniDirectivessniffs. #807 - β Recognize the
wddxextension functionality which will be removed in PHP 7.4 (moved to PECL) in theRemovedExtensionsandRemovedFunctionssniffs. #826 - β New
isShortTernary()andisUnaryPlusMinus()utility methods to thePHPCompatibility\Sniffclass. #810, #805
Changed
- βοΈ The
PHPCompatibility.Extensions.RemovedExtensionssniff will now only report on the removedPayflow Proextension when a function usespfpro_as a prefix. Previously, it used thepfproprefix (without underscore) for detection. #812 - βοΈ The error message thrown when the
T_ELLIPSIStoken, 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.NewParamTypeDeclarationsis now also tested with parameters using the splat operator. #802 - π The documentation now uses the GitHub repo of
PHP_CodeSnifferas the canonical entry point forPHP_CodeSniffer. Previously, it would point to the PEAR package. #788 - π The links in the changelog now all point to the
PHPCompatibility/PHPCompatibilityrepo and no longer to the (deprecated)wimg/PHPCompatibilityrepo. #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-installerComposer plugin has been upped to0.5.0. #791
Fixed
- π The
PHPCompatibility.Extensions.RemovedExtensionssniff contained a typo in the alternative recommended for the removedmcveextension. #806 - π The
PHPCompatibility.Extensions.RemovedExtensionssniff listed the wrong removal version number for thePayflow Pro/pfproextension (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
See all related issues and PRs in the 9.1.1 milestone.