Page MenuHomePhabricator

unexpected NAN value was coerced to string (from Parser/CoreParserFunctions.php:457)
Closed, ResolvedPublic

Description

Cross-reference https://wiki.php.net/rfc/warnings-php-8-5#coercing_nan_to_other_types; T58199: {{formatnum}} arguments 'R' and 'NOSEP' should match the entire string, not just part of the string

  • mediawiki/core (47e8bf1baf66) locally, running PHP 8.5
  • composer phpunit:entrypoint -- --filter ParserIntegrationTest::testParse
1) ParserIntegrationTest::testParse with data set "parserTests.txt: Wrong option for formatNum (T58199)" ('legacy')
unexpected NAN value was coerced to string

/[...]/mediawiki/core/includes/Parser/CoreParserFunctions.php:457
/[...]/mediawiki/core/includes/Parser/Parser.php:6325
/[...]/mediawiki/core/includes/Parser/CoreParserFunctions.php:439
/[...]/mediawiki/core/includes/Parser/Parser.php:3417
/[...]/mediawiki/core/includes/Parser/Parser.php:3072
/[...]/mediawiki/core/includes/Parser/PPFrame_Hash.php:266
/[...]/mediawiki/core/includes/Parser/Parser.php:2895
/[...]/mediawiki/core/includes/Parser/Parser.php:1537
/[...]/mediawiki/core/includes/Parser/Parser.php:624
/[...]/mediawiki/core/tests/Common/Parser/ParserTestRunner.php:1536
/[...]/mediawiki/core/tests/Common/Parser/ParserTestRunner.php:1436
/[...]/mediawiki/core/tests/Common/Parser/ParserTestRunner.php:1467
/[...]/mediawiki/core/tests/phpunit/suites/ParserIntegrationTest.php:71
/[...]/mediawiki/core/tests/phpunit/suites/SuiteEventsTrait.php:67
/[...]/mediawiki/core/tests/phpunit/suites/SuiteEventsTrait.php:67

(note: not yet seen in WMF experimental CI due to the order in which it runs MediaWiki's PHPUnit tests, but it presumably would be seen there at some point)

Event Timeline

Change #1225483 had a related patch set uploaded (by Ammarpad; author: Ammarpad):

[mediawiki/core@master] Avoid coercing NAN/INF/-INF to string

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

Change #1225483 merged by jenkins-bot:

[mediawiki/core@master] Avoid coercing NAN/INF/-INF to string

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

Change #1226236 had a related patch set uploaded (by Reedy; author: Ammarpad):

[mediawiki/core@REL1_45] Avoid coercing NAN/INF/-INF to string

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

Change #1226237 had a related patch set uploaded (by Reedy; author: Ammarpad):

[mediawiki/core@REL1_44] Avoid coercing NAN/INF/-INF to string

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

Change #1226238 had a related patch set uploaded (by Reedy; author: Ammarpad):

[mediawiki/core@REL1_43] Avoid coercing NAN/INF/-INF to string

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

Reedy assigned this task to Ammarpad.

Change #1226236 merged by jenkins-bot:

[mediawiki/core@REL1_45] Avoid coercing NAN/INF/-INF to string

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

Change #1226238 merged by jenkins-bot:

[mediawiki/core@REL1_43] Avoid coercing NAN/INF/-INF to string

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

Change #1226237 merged by jenkins-bot:

[mediawiki/core@REL1_44] Avoid coercing NAN/INF/-INF to string

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