Project

General

Profile

Actions

Bug #65317

closed

Epic #65314: PHP7

TypoScriptParserTest::executeValueModifierReturnsModifiedResult

Added by Alexander Opitz about 9 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
Start date:
2015-02-25
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
7.0
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

TYPO3\CMS\Core\Tests\Unit\TypoScript\Parser\TypoScriptParserTest::executeValueModifierReturnsModifiedResult with data set "sortList sorts a list numeric descending" ('sortList', '10,100,0,20,abc,-20', 'descending,numeric', '100,20,10,0,abc,-20')
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'100,20,10,0,abc,-20'
+'100,20,10,abc,0,-20'

/home/opitz/projects/typo3-master/typo3-src/typo3/sysext/core/Tests/Unit/TypoScript/Parser/TypoScriptParserTest.php:227
/home/opitz/projects/neos-git/Packages/Libraries/phpunit/phpunit/phpunit7:56

=> sort, internally same issue on swap?
=> Same on HHVM

Actions #1

Updated by Alexander Opitz about 9 years ago

  • Description updated (diff)
Actions #2

Updated by Alexander Opitz about 9 years ago

  • Description updated (diff)
Actions #3

Updated by Alexander Opitz almost 9 years ago

  • Status changed from New to Accepted

This issue can be forced in the other tests for sortList, by rearranging the $currentValue in the data provider.

From the PHP documentation of sort

Warning

Be careful when sorting arrays with mixed types values because sort() can produce unpredictable results.

And that's what we get here, as the sorting algorithms are different between PHP5.x and PHP7/HHVM.
By definition of the function the result is not defined.

We have 2 Options:

- Implement a proper solution (which is maybe not so fast)
- Change meaning/documentation of sortList in TypoScript

Actions #4

Updated by Gerrit Code Review over 8 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42112

Actions #5

Updated by Gerrit Code Review over 8 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42112

Actions #6

Updated by Gerrit Code Review over 8 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42112

Actions #7

Updated by Gerrit Code Review over 8 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42112

Actions #8

Updated by Benni Mack over 8 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #9

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF