-
-
Notifications
You must be signed in to change notification settings - Fork 205
Open
Labels
PHP: 7.4Status: to be implementedType: enhancementType: metaRepo strategy/structure relatedRepo strategy/structure related
Description
This is just an issue to keep track of which of the implemented RFCs for PHP 7.4 have been addressed.
This list should be updated when additional RFCs are accepted/implemented.
To Do
- E_WARNING for invalid containers
Raise E_WARNING for array access on invalid containers
Notes:
This is very likely impossible to sniff for reliably.
The only code pattern I can currently come up with which could be used to find at least some of these, would be to sniff foris_array( $var['key'] )and to verify that this is preceded by a check withisset( $var['key'] ), but that would still only find a small percentage of the problem cases and will also flag false positives (where the additionalissetis not needed as the key will always exist). - Base Convert improvements
Changes to base convert to warn the user when incorrect values are passed. Also allow negative numbers to be parsed. - Covariant Returns and Contravariant Parameters
- Preloading
Preload PHP functions and classes once and use them in the context of any future request without overhead. - Improve openssl_random_pseudo_bytes()
Proposes making openssl_random_pseudo_bytes() fail closed and deprecate the second parameter - Escape PDO "?" parameter placeholder
Changes to PDO to allow using operators containing “?” with pdo_pgsql, most commonly the JSON key exists “?” operator. - Deprecations for PHP 7.4
Functionality to be deprecated in PHP 7.4 and removed in PHP 8.0.
Sub-list:
Aside from the RFCs, there are also the changes which were made outside of the RFC process and are listed in:
Claimed
Nothing at this time
Has PR
A ✔️ indicates that the PR has been merged.
- ✔️ Deprecate alternate access to array elements and chars in string - PR PHP 7.4: New RemovedCurlyBraceArrayAccess sniff #855
Deprecate curly braces array and string syntax access. - ✔️ Numeric Literal Separator - PR PHP 7.4: New NewNumericLiteralSeparator sniff #984
Enable improved code readability by supporting an underscore between digits in numeric literals.
Notes:
Any sniff which looks atT_LNUMBERandT_DNUMBERwill also need to be examined to verify they can handle these type of numbers correctly.
If so, unit tests proving this should be added to the sniff.
If not, sniffs may need adjusting and/or an issue may need to be opened in PHPCS upstream to discuss how to handle this change from a Tokenizer perspective.
Also see: PHP 7.4: backfill for tokenizing numeric sequences with an underscore separator squizlabs/PHP_CodeSniffer#2546 - ✔️ Allow throwing exceptions from __toString() - PR PHP 7.4: new NewExceptionsFromToString sniff #814 + NewExceptionsFromToString: 2 bugfixes + 1 enhancement #880
Support throwing exceptions from__toString() - ✔️ Spread Operator in Array Expression - PR PHP 7.4: new NewArrayUnpacking sniff #804 & NewLanguageConstructs: improve T_ELLIPSIS error message text #803
- ✔️ Deprecate left-associative ternary operator - PR PHP 7.4/8.0: new RemovedTernaryAssociativity sniff #810
Deprecate nesting of ternaries without explicit use of parentheses. - ✔️ Arrow functions 2.0 - PR PHP 7.4: New NewArrowFunction sniff #985 + Keywords/NewKeywords: merge
NewArrowFunctionSniff#1593
Adds short closures / arrow functions.
Notes:
1. This change causes the double arrow to take on an additional role and existing sniffs which look at theT_DOUBLE_ARROWtoken should also be reviewed.
2. This change introduces a new way to declare functions and existing sniffs which look at function declarations should also be reviewed.
3. This change introduces a new tokenT_FNwhich PHPCS - currently - does not yet backfill for older PHP versions.
Also see: PHP 7.4: arrow functions squizlabs/PHP_CodeSniffer#2523 Edit: fixed in PHPCS since the origin note was made
4. This change introduces a new semi-reserved keyword. - ✔️ Deprecate and remove ext/interbase - PR PHP 7.4: account for removal of the interbase/Firebird extension #807
Deprecate and eventually remove the InterBase extension in the Core - ✔️ weakrefs - PR PHP 7.4/NewClasses: add WeakReferences #857
- ✔️ FFI - Foreign Function Interface - PR PHP 7.4: Add detection of features from the new FFI extension detection #949 + ReservedNames: refactor to allow for detecting more reserved names #1592
- ✔️ Typed Properties 2.0 - PR PHP 7.4: new NewTypedProperties sniff #801
Add support for typed properties, including static properties and references to typed properties. - ✔️ Null Coalesce Equal Operator - PR PHP 7.2: Add sniffing for usage of the T_COALESCE_EQUAL token #340
Allow shorthand for self assigning null coalesce operator - ✔️ Password Hash Registry - PR PHP 7.4: NewFunctions: add password_algos() #827 + PHP 7.4: new NewPasswordAlgoConstantValues sniff #865
Make the mechanisms used by password_hash/verify/etc… extensible by other modules. - ✔️ mb_str_split() Split multibyte string - PR PHP 7.4/NewFunctions: detect new mb_str_split() #811
- ✔️ Reflection for references - PR PHP 7.4: NewClasses: add ReflectionReference class #820
Introduces the ReflectionReference class to allow detecting references and determining reference equality. - ✔️ Unbundle ext/wddx - PR PHP 7.4: unbundle ext/wddx #826
- ✔️ New custom object serialization mechanism - PR PHP 7.4: Custom object serialization RFC #868
Introduces new custom object serialization mechanism to replace Serializable. - ✔️ Change the precedence of the concatenation operator - PR PHP 7.4/8.0: new ChangedConcatOperatorPrecedence sniff #805
- ✔️ Argon2 support from sodium - PR PHP 7.4/NewConstants: more new PHP 7.4 constants #887
Provide password_hash() support for argon2i/argon2id from ext/sodium if standard does not. - ✔️ Unbundle ext/recode - PR PHP 7.4: unbundle ext/recode #841
- Deprecations for PHP 7.4
Functionality to be deprecated in PHP 7.4 and removed in PHP 8.0.
Sub-list:- ✔️ The real type - PR PHP 7.4/RemovedTypeCasts: handle deprecated (real) typecast #844 + PHP 7.4/RemovedFunctions: handle removed functions from the Deprecations RFC #847
- ✔️ Magic quotes legacy - PR PHP 7.4/RemovedFunctions: handle removed functions from the Deprecations RFC #847
- ✔️ FILTER_SANITIZE_MAGIC_QUOTES filter - PR PHP 7.4/RemovedConstants: handle deprecated magic quote related filter constant #845
- ✔️ mb_strrpos() with encoding as 3rd argument - PR PHP 5.2/7.4: new RemovedMbStrrposEncodingThirdParam sniff #860
- ✔️ implode() parameter order mix - PR PHP 7.4: New ParameterValues/RemovedImplodeFlexibleParamOrder sniff #846
- ✔️ hebrevc() function - PR PHP 7.4/RemovedFunctions: handle removed functions from the Deprecations RFC #847
- ✔️ convert_cyr_string() function - PR PHP 7.4/RemovedFunctions: handle removed functions from the Deprecations RFC #847
- ✔️ money_format() function - PR PHP 7.4/RemovedFunctions: handle removed functions from the Deprecations RFC #847
- ✔️ ezmlm_hash() function - PR PHP 7.4/RemovedFunctions: handle removed functions from the Deprecations RFC #847
- ✔️ restore_include_path() function - PR PHP 7.4/RemovedFunctions: handle removed functions from the Deprecations RFC #847
- ✔️ allow_url_include ini directive - PR PHP 7.4/RemovedIniDirectives: handle deprecated allow_url_include #870
Reviewed and concluded non-sniffable
- Always available hash extension
Proposes to make the hash extension available to every build of PHP.
Notes:
The only thing which could be sniffed for is calls toextension_loaded(),function_exists()et al, checking for the availability of the hash extension.
Those calls are no longer needed.
However, this is not a compatibility issue, those calls will now always returntrue, so leaving them in place doesn't break anything.
This might be something to sniff for in thePHPModernizerstandard with a recommendation that those calls can now be removed.
Process
If anyone starts work on updating PHPCompatibility to handle any of these issues, please either update the above list (if you can) or leave a comment below, so one of the maintainers can update the list.
Once PHP 7.4 comes out, individual issues should be opened for the changes which remain at that point in time.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
PHP: 7.4Status: to be implementedType: enhancementType: metaRepo strategy/structure relatedRepo strategy/structure related