Page MenuHomePhabricator

Make MediaWiki core compatible with PHP 7.4
Open, LowPublic

Description

Since PHP 7.4.0 has been released, we can start thinking about the compatibility.

The following is the problems from phpunit unit test:

Function ReflectionType::__toString() is deprecated

tests/phpunit/unit/includes/watcheditem/NoWriteWatchedItemStoreUnitTest.php:225
tests/phpunit/MediaWikiUnitTestCase.php:110
maintenance/doMaintenance.php:99
  • Deprecated: Array and string offset access syntax with curly braces is deprecated in avro-php lib. (php-7.4.0RC1 note)
  • MWExceptionHandlerTest::testGetRedactedTrace: The stacktrace must have a function having an object has parameter; Failed asserting that false is true.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 16 2019, 2:20 PM
RazeSoldier updated the task description. (Show Details)Sep 16 2019, 2:28 PM

Change 537139 had a related patch set uploaded (by TK-999; owner: TK-999):
[avro-php@master] protocol: Fix compatibility with PHP 7.4

https://gerrit.wikimedia.org/r/537139

TK-999 added a subscriber: TK-999.Sep 16 2019, 3:19 PM

The issue in the RemexHTML lib seems to have been fixed in https://gerrit.wikimedia.org/r/c/mediawiki/libs/RemexHtml/+/531022.

The issue in the RemexHTML lib seems to have been fixed in https://gerrit.wikimedia.org/r/c/mediawiki/libs/RemexHtml/+/531022.

Yep, but MW is still using the old version. May need update dependence.

Change 537181 had a related patch set uploaded (by TK-999; owner: TK-999):
[mediawiki/core@master] services: Do not use deprecated ReflectionType::__toString() in tests

https://gerrit.wikimedia.org/r/537181

Change 537188 had a related patch set uploaded (by TK-999; owner: TK-999):
[mediawiki/core@master] SectionProfiler: Do not attempt to use null values as arrays

https://gerrit.wikimedia.org/r/537188

Change 537139 merged by jenkins-bot:
[avro-php@master] protocol: Fix compatibility with PHP 7.4

https://gerrit.wikimedia.org/r/537139

Change 537188 merged by jenkins-bot:
[mediawiki/core@master] SectionProfiler: Do not attempt to use null values as arrays

https://gerrit.wikimedia.org/r/537188

Reedy triaged this task as Low priority.Sep 16 2019, 11:42 PM
Reedy added a project: MediaWiki-General.

Change 537181 merged by jenkins-bot:
[mediawiki/core@master] services: Do not use deprecated ReflectionType::__toString() in tests

https://gerrit.wikimedia.org/r/537181

Change 537685 had a related patch set uploaded (by C. Scott Ananian; owner: C. Scott Ananian):
[mediawiki/core@master] Update remex-html library to 2.1.0

https://gerrit.wikimedia.org/r/537685

Change 537779 had a related patch set uploaded (by C. Scott Ananian; owner: C. Scott Ananian):
[mediawiki/vendor@master] Update remex-html to 2.1.0

https://gerrit.wikimedia.org/r/537779

Change 537779 merged by jenkins-bot:
[mediawiki/vendor@master] Update remex-html to 2.1.0

https://gerrit.wikimedia.org/r/537779

Change 537685 merged by jenkins-bot:
[mediawiki/core@master] Update remex-html library to 2.1.0

https://gerrit.wikimedia.org/r/537685

RazeSoldier updated the task description. (Show Details)Sep 20 2019, 5:08 PM

I think we can announce support for PHP 7.4 in MediaWiki 1.35 release.

Reedy updated the task description. (Show Details)Sep 20 2019, 5:50 PM

Tagging MW-1.35-release, make this ticket as a MW 1.35 release blocker.

There are enough reasons to think that the next version (1.35) supports PHP 7.4 is a good choice.

MaxSem changed the status of subtask T192167: Upgrade PHPUnit from 4/6 to 8 from Stalled to Open.Oct 4 2019, 6:16 AM

Change 541657 had a related patch set uploaded (by MaxSem; owner: MaxSem):
[mediawiki/core@master] Travis: test on PHP 7.4, allowing failures

https://gerrit.wikimedia.org/r/541657

Reedy updated the task description. (Show Details)Oct 8 2019, 11:52 PM

Change 541657 merged by jenkins-bot:
[mediawiki/core@master] Travis: test on PHP 7.4, allowing failures

https://gerrit.wikimedia.org/r/541657

Jdforrester-WMF changed the status of subtask T236132: Provide CI testing for PHP 7.4 from Open to Stalled.Oct 30 2019, 3:33 PM

Change 552394 had a related patch set uploaded (by MaxSem; owner: MaxSem):
[mediawiki/core@master] PHP 7.4 fixes

https://gerrit.wikimedia.org/r/552394

Change 552394 merged by jenkins-bot:
[mediawiki/core@master] PHP 7.4 fixes

https://gerrit.wikimedia.org/r/552394

Jdforrester-WMF changed the status of subtask T236132: Provide CI testing for PHP 7.4 from Stalled to Open.Dec 2 2019, 5:05 PM

Weird. I skimmed through PHP 7.4 UPGRADING, and couldn't find anything interesting. I've also tested the faulty code on 3v4l (I still have to install PHP 7.4 locally), but the trace seems to have an object there.

Change 554202 had a related patch set uploaded (by MaxSem; owner: MaxSem):
[mediawiki/core@master] WIP: fix PHP 7.4 error

https://gerrit.wikimedia.org/r/554202

MaxSem added a subscriber: MaxSem.Dec 3 2019, 1:59 AM

Weird. I skimmed through PHP 7.4 UPGRADING, and couldn't find anything interesting. I've also tested the faulty code on 3v4l (I still have to install PHP 7.4 locally), but the trace seems to have an object there.

Here:

zend.exception_ignore_args is a new INI directive for including or excluding arguments from stack traces generated from exceptions.

MaxSem added a comment.Dec 3 2019, 2:22 AM

And of course, it's not documented in https://www.php.net/manual/en/ini.list.php.

Change 554202 merged by jenkins-bot:
[mediawiki/core@master] Fix MWExceptionHandlerTest on PHP 7.4

https://gerrit.wikimedia.org/r/554202

Change 554326 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[integration/config@master] layout: [mediawiki/core] Test with PHP74 for master

https://gerrit.wikimedia.org/r/554326

Here:

zend.exception_ignore_args is a new INI directive for including or excluding arguments from stack traces generated from exceptions.

Ah, nice catch. Sometimes it's surpsising to see how well the human brain can skip the exact section of a document that you're looking for.

Change 554368 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[integration/config@master] layout: [skins] Add PHP74 tests as voting for master

https://gerrit.wikimedia.org/r/554368

Change 554368 merged by jenkins-bot:
[integration/config@master] layout: [skins] Add PHP74 tests as voting for master

https://gerrit.wikimedia.org/r/554368

Mentioned in SAL (#wikimedia-releng) [2019-12-03T21:24:16Z] <James_F> Enabling PHP74 tests as voting for MW skins T233012

SitRep:

Core itself works, but I'm not sure about all tarball extensions yet, so won't enable this there.

Skins were all working except Minerva, now fixed in T239727: MinervaNeue is not compatible with PHP7.4, so that's enabled.

Extensions found broken so far are T239726: ConfirmEdit is not compatible with PHP7.4, T239757: CirrusSearch is not compatible with PHP7.4, T239759: TimedMediaHandler is not compatible with PHP7.4, T239760: WikibaseLib is not compatible with PHP7.4, T239761: Wikibase is not compatible with PHP7.4.

Change 554669 had a related patch set uploaded (by MaxSem; owner: MaxSem):
[mediawiki/core@master] UnregisteredLocalFile: fix PHP 7.4 warnings

https://gerrit.wikimedia.org/r/554669

Change 554669 merged by jenkins-bot:
[mediawiki/core@master] UnregisteredLocalFile: fix PHP 7.4 warnings

https://gerrit.wikimedia.org/r/554669

SitRep:
Core itself works, but I'm not sure about all tarball extensions yet, so won't enable this there.
Skins were all working except Minerva, now fixed in T239727: MinervaNeue is not compatible with PHP7.4, so that's enabled.
Extensions found broken so far are T239726: ConfirmEdit is not compatible with PHP7.4, T239757: CirrusSearch is not compatible with PHP7.4, T239759: TimedMediaHandler is not compatible with PHP7.4, T239760: WikibaseLib is not compatible with PHP7.4, T239761: Wikibase is not compatible with PHP7.4.

Skins are now un-enabled because of T242980. Fun.