Page MenuHomePhabricator

Accommodate PHP 7.4 changes to certain "preg_match_all()" calls
ClosedPublic

Authored by epriestley on Apr 26 2020, 3:32 PM.
Tags
None
Referenced Files
F19083301: D21173.id50419.diff
Tue, Dec 2, 12:33 PM
F19083300: D21173.id50418.diff
Tue, Dec 2, 12:33 PM
F19083299: D21173.id50415.diff
Tue, Dec 2, 12:33 PM
F19081133: D21173.id50415.diff
Tue, Dec 2, 4:13 AM
F19074865: D21173.id50414.diff
Mon, Dec 1, 7:15 AM
F19068044: D21173.id50419.diff
Sun, Nov 30, 11:21 AM
F19047516: D21173.id.diff
Thu, Nov 27, 1:03 PM
F19034826: D21173.diff
Nov 25 2025, 3:07 PM
Subscribers
None

Details

Summary

Ref T13518. The result format of this call changed in PHP 7.4, which causes us to emit "-1" matches because "-1" survives array_filter().

Filter results in a way that should survive both result formats.

Test Plan

Ran arc unit --everything under PHP 7.4.

Diff Detail

Repository
rARC Arcanist
Branch
php741
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 24233
Build 33377: Run Core Tests
Build 33376: arc lint + arc unit

Unit TestsFailed

TimeTest
13 msArcanistDoubleQuoteXHPASTLinterRuleTestCase::testLinter
Assertion failed, expected values to be equal (at ArcanistLinterTestCase.php:169): Some linters failed: - RuntimeException: Uninitialized string offset: 1
13 msXHPASTNodeTestCase::testGetStringVariables
EXCEPTION (RuntimeException): Uninitialized string offset: 1 #0 /core/data/drydock/workingcopy-88/repo/arcanist/src/parser/xhpast/api/XHPASTNode.php(172): PhutilErrorHandler::handleError(8, 'Uninitialized s...', '/core/data/dryd...', 172, Array) #1 /core/data/drydock/workingcopy-88/repo/arcanist/src/parser/xhpast/api/__tests__/XHPASTNodeTestCase.php(26): XHPASTNode->getStringVariables()
1 msAbstractDirectedGraphTestCase::testCyclicGraph
1 assertion(s) passed.
0 msAbstractDirectedGraphTestCase::testEdgeLoadFailure
1 assertion(s) passed.
0 msAbstractDirectedGraphTestCase::testNonTreeGraph
1 assertion(s) passed.
View Full Test Results (2 Failed · 541 Passed · 34 Skipped)

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Apr 26 2020, 3:32 PM
Harbormaster failed remote builds in B24233: Diff 50414!
  • Swap order to work better under PHP 7.3 and earlier.
Harbormaster returned this revision to the author for changes because remote builds failed.Apr 26 2020, 3:35 PM
Harbormaster failed remote builds in B24234: Diff 50415!
  • Actually look at the PHP 7.3x output before writing code for it.
  • Third try's the charm!
This revision was not accepted when it landed; it landed in state Needs Review.Apr 26 2020, 3:39 PM
epriestley requested review of this revision.
This revision was automatically updated to reflect the committed changes.