Epic #65314: PHP7
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 8 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