PHPCompatibility / PHPCompatibility/PHPCompatibility
Account for changes introduced in PHP 8.6
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 2.3k
- Forks
- 201
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 42
Description
This is just an issue to keep track of which of the implemented RFCs for PHP 8.6 have been addressed.
This list should be updated when additional RFCs are accepted/implemented.
To Do
- Stream Error Handling Improvements
Note: the classes/enums/function etc are addressed via PR #2069. Still needs evaluation whether the new stream error context options are sniffable. - Allow Object Property Writes on Objects Referenced by Constants
- Limit maximum number of filter chains
- Add Locale::getDisplayKeyword and Locale::getDisplayKeywordValue functions
Note: the procedural functions have been addressed via PR #2076. The OO methods still needs detecting. - Secure Session Configuration Defaults
- DocComments For Function Parameters
- isReadable/Writeable Reflection methods
- New function mysqli_quote_string
Note: the procedural function has been addressed via PR #2091. The OO method still needs detecting. - TLS Session Resumption Support for Streams
Note: the classes are addressed via PR #2074. Still needs evaluation whether the new stream context options are sniffable. - Display Function Arguments in Errors
Note: the ini has been addressed via PR #2075. We may also want to investigate whether a useful detection can be set up for custom error handlers which would be impacted viaset_error_handler. - Closure optimizations
- Readonly Property Defaults
Initial review notes by @jrfnl:- should check for
readonlyclasses and then check for a default value on each property - for non-readonly classes, should check each property to see if it is readonly and if so, check for a default value.
- MAYBE: if a readonly property has a default value, check for assignments to the property/increment/decrement/unsetting of the property in the class code and flag them as errors ?
=> Mind: a single assignment to the property is allowed within a __clone() or unserialize() method!
- should check for
- SNMP improvements for encryption protocols, mib reset, and controlling output
- Deprecations for PHP 8.6
Note: these may not all be fully implemented yet! PRs to detect the deprecation will only be accepted after the deprecation has been merged into PHP Core.
Sublist:- Deprecate using certain names as identifiers to reserve them as keywords
- Passing objects which are interpreted as arrays
- Passing objects for $array parameter of array_walk() and array_walk_recursive() - PR - commit
- Passing objects for $options parameter of deflate_init() and inflate_init() - PR - commit
- Passing objects as parameters to the zlib.inflate and zlib.deflate stream filters - PR - commit
- Passing objects as parameters to the bzip2.decompress and bzip2.compress stream filters - PR - commit
- Passing objects for $vars parameter of mb_convert_variables() - PR - commit
- Passing objects for $data parameter of http_build_query() - PR - commit
- Deprecate ReflectionProperty::setValue() and ReflectionProperty::setRawValue() with wrong types - PR - commit + commit
- Deprecate ReflectionMethod::invoke() and ReflectionMethod::invokeArgs() with objects for static methods - PR - commit
- Deprecate ArrayIterator methods that inherit ArrayObject implementation - PR - commit
- Deprecate SplFileObject CSV methods - PR - commit
- Deprecate mysqli::stmt_init() - PR - commit
Note: the procedural function has been addressed via PR #.... The OO method + constructor signature still needs detecting. - Deprecate mysqli_get_charset() - PR - commit
Note: the procedural function has been addressed via PR #2095. The OO method still needs detecting. - Deprecate passing a $sessionhandler object to session_set_save_handler() which does not contain the create_sid() and validateId() methods - PR - commit
Aside from the RFCs, there are also the changes which were made outside of the RFC process and are listed in:
- The PHP 8.6 Upgrading guide.
- The PHP 8.5 to 8.6 Migration guide (once available)
- PHP 8.6 NEWS/Changelog
- Changelog
Claimed
- #[\Override] for class constants
Status: TODO / needs a good think, see #1935
Owner: @jrfnl - Polling API
Status: PR #2086 addresses most. Enums will be addressed via upcoming newNewEnumssniff.
Owner: @jrfnl - enum SortDirection
Status: WIP via upcoming newNewEnumssniff.
Owner: @jrfnl - Partial Function Application, v2
- Partial Function Application: Handling of Optional Parameters
Status: Needs tokenizer support in PHPCS
Owner: @jrfnl
- Partial Function Application: Handling of Optional Parameters
- Deprecations for PHP 8.6
Sublist:- Deprecate mysqli::stmt_init() - PR - commit
Status: Ready to be pulled for the procedural function.
Owner: @jrfnl
- Deprecate mysqli::stmt_init() - PR - commit
Additionally, an initial scan of the UPGRADING file for additional list-based updates to be made is ongoing and owned by @jrfnl.
Has PR
- Add pack()/unpack() endianness modifiers for floating-point numbers - PR #2071
- Add pack()/unpack() support for endianness modifiers on integers - PR #2071
- Stream Error Handling Improvements - PR #2069
- Deprecate returning values from __construct() and __destruct() - PR #2064
- Add Locale::getDisplayKeyword and Locale::getDisplayKeywordValue functions - PR #2076
- Polling API - PR #2086
- Debugable Enums - PR #2067
- Oniguruma maintenance end and end of mbregex - PR #2066
- Add Form Feed in Trim Functions - PR #2068
- grapheme_strrev: strrev for grapheme cluster - PR #2083
- Add "clamp()" function - PR #2087
- New function mysqli_quote_string - PR #2091
- TLS Session Resumption Support for Streams - PR #2074
- Display Function Arguments in Errors - PR #2075
- Duration class - PR #2082
- Deprecations for PHP 8.6
Sublist:- Deprecate returning from a finally block - PR - commit -- PR #2063
- Deprecate using certain names as identifiers to reserve them as keywords
- Deprecate using “namespace” as a class constant name - PR - commit -- PR #2079
- Deprecate the possibility to name a function “readonly” - PR - commit -- PR #2065
- Deprecate function aliases with non-canonical type name
- Deprecate is_double(), an alias of is_float() - PR - commit -- PR #2073
- Deprecate is_integer(), an alias of is_int() - PR - commit -- PR #2073
- Deprecate is_long(), an alias of is_int() - PR - commit -- PR #2073
- Deprecate doubleval(), an alias of floatval() - PR - commit -- PR #2073
- Deprecate is_subclass_of with string when $allow_string is false - PR - commit -- PR #2078
- Deprecate is_a with string when $allow_string is false - PR - commit -- PR #2078
- Deprecate strcoll() - PR - commit -- PR #2080
- Deprecate SORT_LOCALE_STRING flag for sort() functions - PR - commit -- PR #2072
- Deprecate metaphone function - PR - commit -- PR #2085
- Deprecate spl_classes() - PR - commit -- PR #2089
- Deprecate spl_object_hash - PR - commit -- PR #2092
- Deprecate mysqli_get_charset() - PR - commit -- PR #2095
Reviewed and concluded non-sniffable
- Deprecations for PHP 8.6
Sublist:- Deprecate define() with $case_insensitive being specified - PR - commit
Reviewed by @jrfnl and concluded there's nothing to do here for PHPCompatibility.
"This appears to be a correction to the implementation of the removal of support for case-sensitive constants in PHP 8.0 as previously deprecated in PHP 7.3.
In my opinion, this is an irrelevant implementation error on the side of PHP and the actual removal of support for case-sensitive constants is what PHPCompatibility should flag and already does via theRemovedFunctionParameterssniff."
Relevant PHPCompatibility PRs: #706 and #1185
- Deprecate define() with $case_insensitive being specified - PR - commit
Rejected RFCs
- Deprecations for PHP 8.6
Sublist:Deprecate the list() constructRFC rejected- Deprecate using certain names as identifiers to reserve them as keywords
Deprecate dechunk filterRFC rejected
Delayed to later PHP version
Nothing yet
Status yet to be determined
These are RFCs which have either not yet been implemented or are still in voting at this time.
Once their final status for PHP 8.6 is determined, they will either be moved to the "To Do" list or removed from this ticket.
Accepted, not yet (fully) implemented
- Minimum supported versions for PHP 8.6
Already reviewed by @jrfnl and concluded there's nothing to do here for PHPCompatibility. - Followup Improvements for ext/uri
- Deprecations for PHP 8.6
Sublist:
In voting
All votes have been closed
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 8.6 comes out, individual issues should be opened for the changes which remain at that point in time.
Guidelines
- When in doubt how to address something and/or if your approach is the right one: ask.
This also means that it is perfectly acceptable to open an dedicated issue to discuss a particular change in more detail. - PRs which address RFCs should only contain the changes for one RFC per PR. One RFC may warrant multiple PRs depending on the nature of the changes.
Exception: when a RFC builds onto a previous RFC, combining the necessary changes into one PR addressing the cumulative changes to PHP is fine. - PRs not directly related to RFCs may address multiple changes in one go, as long as the changes are logically closely related (like adding a range of new constants to be detected).
- Please include relevant change justification and links in each commit message.
Typically this means that a commit message should include:- Text snippet from the PHP
UPGRADINGguide/changelog/migration guide or the RFC to back up the change being made. - A link to the RFC (if applicable).
- A link to the exact
UPGRADINGguide/changelog/migration guide section which documents the change in PHP Core. - A link to the PR to PHP Core which proposed the change (if applicable).
- A link to the commit which added the change to PHP Core.
- Text snippet from the PHP
- Changes which were proposed/accepted for PHP, but have not been merged into PHP Core yet, should not be detected by PHPCompatibility (yet).
The commit to PHP Core should always come first, PHPCompatibility follows.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the unchecked RFC entries and the PHP 8.6 UPGRADING, migration, NEWS, and changelog references listed in the issue. Check the linked RFC details and existing PR or owner notes before choosing one focused change; done means the relevant PHP 8.6 behavior is detected and the checklist can be updated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100