Bug #65317
closedEpic #65314: PHP7
TypoScriptParserTest::executeValueModifierReturnsModifiedResult
100%
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
Updated by Alexander Opitz over 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
Updated by Gerrit Code Review over 9 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
Updated by Gerrit Code Review over 9 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
Updated by Gerrit Code Review over 9 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
Updated by Gerrit Code Review over 9 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
Updated by Benni Mack over 9 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 375b7cb6111568c2cbad26ea2c8c302150903e5a.
Updated by Riccardo De Contardi about 7 years ago
- Status changed from Resolved to Closed