#40109 closed task (blessed) (fixed)
Ensure PHP 7.2 compatibility in tests (and core)
Reported by: | ocean90 | Owned by: | johnbillion |
---|---|---|---|
Milestone: | 4.9 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Build/Test Tools | Keywords: | needs-patch |
Focuses: | Cc: |
Description
The lastest Travis build for 7.2-dev has a few errors. I haven't found a roadmap but I think PHP 7.2 is planned for end of this year. So, while PHP 7.2 is still at the beginning we should start looking at the results and review each error. We did the same for PHP 7.1 and identified a bug in PHP itself, see #37295.
PHP 7.2 is going to deprecate
create_function()
__autoload()
each()
- calling
assert()
with a string argument
Also, counting of non-countable objects will start throwing a warning in PHP 7.2.
create_function()
is handled in #37082.- The
assert()
calls inWP_Import_UnitTestCase::_import_wp()
should be replaced withassertTrue()
and a custom message. testXMLParser::parse()
:sizeof()
returns always1
for a string, even if the string is empty. Same forfalse
. Seems like we can just passtrue
as the third argument forxml_parse()
.
Attachments (7)
Change History (43)
#3
follow-up:
↓ 4
@
8 years ago
Added a patch to #37082 for all create_function()
calls in unit tests.
Just added a patch here for removing each()
calls. There are 16 other occurrences, but all within Snoopy and the Text_diff library.
I believe Snoopy is an abandoned project (hasn't been updated since 2014). Is this maintained in WordPress as a fork? I can update the patch if so.
Text_Diff
also appears to not be maintained.
#4
in reply to:
↑ 3
@
8 years ago
Replying to desrosj:
I believe Snoopy is an abandoned project (hasn't been updated since 2014). Is this maintained in WordPress as a fork? I can update the patch if so.
A quick look at the history of wp-includes/class-snoopy.php
shows it's been continuing to receive compatibility updates where and when required these past few years since being deprecated ~7 years ago r14052
#5
@
7 years ago
- Milestone changed from Future Release to 4.8
Moving to 4.8 for visibility, in case we don't get 4.9 out before PHP 7.2.
#8
@
7 years ago
Regarding a roadmap for PHP 7.2 I only found this: https://wiki.php.net/todo/php72
This ticket was mentioned in Slack in #core by obenland. View the logs.
7 years ago
#12
@
7 years ago
- Milestone changed from Future Release to 4.9
WordPress 4.9 will be out before PHP 7.2, WordPress 5.0 may or may not be.
#14
@
7 years ago
Excerpt from #41134, I submitted a patch to remove move the legacy autoloader code to a new file and include it only if SPL is not available, and that fixed the deprecation notice in PHP 7.2, without removing the SPL polyfill.
I will attach that patch here as well.
#15
@
7 years ago
- Priority changed from low to normal
FYI: PHP 7.2 alpha has been tagged and is now available on Travis as 7.2
.
#16
@
7 years ago
Also, PHP 7.2 is now branched off and has feature frozen (https://externals.io/message/99903).
#17
@
7 years ago
Opened #41457 for the incorrect use of count()
in WP_REST_Comments_Controller::check_read_post_permission()
.
#22
@
7 years ago
- Keywords needs-patch added; has-patch removed
At least one of the fixes in 40109.4.patch for usage of each()
is buggy because the array that's iterated over is altered during iteration. Needs a more comprehensive patch.
#23
@
7 years ago
The each()
issue is potentially complex, so I'm splitting each (heh) usage into its own ticket. First up: #41524
This ticket was mentioned in Slack in #core by sergey. View the logs.
7 years ago
#29
@
7 years ago
- Owner set to johnbillion
- Resolution set to fixed
- Status changed from new to closed
In 41748:
#31
@
7 years ago
The tests are passing (https://travis-ci.org/WordPress/wordpress-develop/jobs/285002396)!
Related #37082.