#47746 closed defect (bug) (fixed)
PHP 7.4 compatibility fix / implode argument order
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 5.3 | Priority: | normal |
Severity: | normal | Version: | |
Component: | General | Keywords: | has-patch php74 has-dev-note |
Focuses: | coding-standards | Cc: |
Description
implode()
takes two parameters, $glue
and $pieces
.
For historical reasons, implode()
accepted these parameters in either order, though it was recommended to use the documented argument order of implode( $glue, $pieces )
.
PHP 7.4 is slated to deprecate the tolerance for passing the parameters for implode()
in reverse order.
PHP 8.0 is expected to remove the tolerance for this completely.
Refs:
- https://wiki.php.net/rfc/deprecations_php_7_4#implode_parameter_order_mix
- https://php.net/manual/en/function.implode.php
Related:
Note: join()
is an alias of implode()
. It is generally considered best practice to use the canonical function rather than an alias, however, that is outside the scope of this ticket.
Attachments (5)
Change History (31)
#2
follow-up:
↓ 3
@
6 years ago
- Version trunk deleted
The changes to Requests and Simplepie need to be made upstream to their respective repos.
The other two changes look good.
#3
in reply to:
↑ 2
@
6 years ago
Replying to johnbillion:
The changes to Requests and Simplepie need to be made upstream to their respective repos.
The other two changes look good.
Pull requests to both upstream repos have already been opened (see links above), but neither is very actively maintained.
The Requests
dependency in Core is at the latest version - 1.7
-, but that version was released in October 2016 (!!!).
Ref: https://github.com/rmccue/Requests/releases
The Requests
repo has had no commits since December 2017 and only a few, mostly DevOps related ones since the last release.
The SimplePie
dependency in Core is at version 1.3.1
- which was released in October 2012 😰, while the current version is 1.5.2
released in August 2018.
Ref: https://github.com/simplepie/simplepie/releases
And while the SimplePie
repo has actually had some commits this year (February), the version used in WP Core is pretty far behind the latest release.
So, yes, while I agree that the fixes should primarily be made upstream, I don't think WP should be throwing deprecation notices when run on PHP 7.4 while we are waiting for
1) new releases from upstream and
2) the existing WP Core versions of those libraries to be updated.
#5
@
5 years ago
FYI:
- The PR to SimplePie has been merged, but no new version has been tagged yet. I've opened an issue asking for them to tag a new release: https://github.com/simplepie/simplepie/issues/620
- The PR to Requests has had no response whatsoever. I've bumped the PR hoping to get some traction: https://github.com/rmccue/Requests/pull/346#issuecomment-531415325
The patch for Core looks good and should IMO be committed ASAP.
#8
@
5 years ago
- Keywords close added; commit removed
I'm leaving this open for now, but it may be best to tackle the remaining issues in separate tickets to update the two libraries.
I know @jrf has been working with @rmccue to get a new version of Requests released, but it does not seem SimplePie has seen any traction.
#11
@
5 years ago
Status summary:
- Issues in WP Core native code have been fixed.
- Issues in the external
Requests
andSimplePie
libraries remain unpatched at this moment.
Regarding SimplePie
:
- Ticket #36669 is open to address this, but has just been punted to
Future Release
. - The issue has been patched upstream, but is not contained in a tagged release yet.
- If SimplePie does not get updated to a more recent version in WP 5.3, the existing code should be patched for the time being. I will attach a patch for this.
Regarding Requests
:
- The issue has been patched upstream (above mentioned PR has been merged in the mean time), but is not contained in a tagged release yet.
- Still hoping for a new tagged release over the next few days to go into WP 5.3.
#12
@
5 years ago
SimplePie has released a new version including the changes needed for PHP 7.4 support: https://github.com/simplepie/simplepie/releases/tag/1.5.3
#13
@
5 years ago
- Keywords needs-testing added; close removed
47746-simplepie-1-5-3.diff updates SimplePie to version 1.5.3.
Here is a test build on my fork: https://travis-ci.org/desrosj/wordpress-develop/builds/588479168
#14
@
5 years ago
Since there has been no tagged release for Requests, requests-1-7-3470169.diff updates Requests to version 1.7.3470169
, which corresponds to the most recent commit.
#15
@
5 years ago
@desrosj 👍🏻
FYI: Just checked with @rmccue regarding Requests
and the intention is still to try and get a new release tagged over the next week.
#16
@
5 years ago
Safety first with regards to SimplePie. It's so late in the 5.3 cycle that I don't feel comfortable making a decision at this point. Please follow the related ticket, #36669, where we will introduce the library update in the next development cycle to ensure proper time to validate compatibility among plugin authors.
This ticket was mentioned in Slack in #core by ocean90. View the logs.
5 years ago
#18
@
5 years ago
Let's move forward with 47746-patch-up-SimplePie.patch and requests-1-7-3470169.diff with the intention to fully update SimplePie
through #36669 in 5.4, and when Requests
is officially tagged the version string can be changed during beta.
#23
@
5 years ago
- Keywords close added; needs-testing removed
@iseulde Thanks for catching that newly introduced issue straight away ;-)
@desrosj Thanks for committing these last two patches.
I think we can close this ticket now as the current code base should be clean of the issue now.
Fingers crossed 🤞🏻 no further new issues of this type will be introduced.
A new issue can/should probably be created to update Requests
to the newly tagged version once released.
#24
@
5 years ago
- Keywords close removed
- Resolution set to fixed
- Status changed from assigned to closed
Thanks, everyone for the work on this!
FYI: I have reviewed ALL function calls to
implode()
andjoin()
to get at this patch. Based on the currenttrunk
, there are no remaining issues.